| |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
-> 大数据 -> MongoDB Interview Summary Questions -> 正文阅读 |
|
[大数据]MongoDB Interview Summary Questions |
2. What are some of the advantages of MongoDB?Some advantages of MongoDB are as follows:
3.What is a Document in MongoDB?A Document in MongoDB is an ordered set of keys with associated values.It is represented by a map,hash,or dictionary.In JavaScript,documents are represented as objects: ["greeting":"Hello world!"] Complex documents will contain multiple key/value pairs: {"greeting":"Hello world","views":3} 4.What is a Collection in MongoDB?A collection in MongoDB is a group of documents.If a document is the MongoDB analog of a row in a relational database,then a collection can be thought of as the analog to a table.Documents within a single collection can have any number of different "shape",collections have dynamic schemas. For example,both of the following documents could be stored in a single collection: {"greeting":"Hello world!","views":3} {"signoff":"Good bye"} 5.What are Databases in MongoDB?MongoDB groups collections into databases.MongoDB can host several databases,each grouping together collections. Some reserved database names are as follows:
6.What is the Mongo Shell?It is a JavaScript shell that allows interaction with a MongoDB instance from the command line.With that one can perform administrative functions,inspecting an instance,or exploring MongoDB. 7.What are some features of MongoDB?
8.How to add data in MongoDB?The basic method for adding data to MongoDB is "inserts" To insert a single document,use the collection's insertOne method: db.books.insertOne("title":"Start with Why") 9.How does Scale-Out occur in MongoDB?The document-oriented data model of MongoDB makes it easier to split data across multiple servers.Balancing and loading data across a cluster is done by MongoDB.It then redistribute documents automatically. The mongos acts as a query router,providing an interface between client applications and the sharded cluster. Config servers store metadata and configuration settings for the cluster.MongoDB uses the config servers to manage distributed locks. Each sharded cluster must have it own config server. 10.How do you Update a Document?Once a document is stored in the database,it can be changed using one of several update methods: updateOne,updateMany, and replaceOne,updateOne and updateMany each takes a filter document as their first parameter and a modifer document, which describes changes to make,as the second parameter.replaceOne also takes a filter as the first parameter,but as the second parameter.replaceOne aslo takes a filter as the first parameter, but as the second parameter replaceOne expects a document with which it will replace the document matching the filter. 10.How do you Delete a Document?The CRUD API in MongoDB provides deleteOne and deleteMany for this purpose.Both of these methods take a filter document as their first parameter.The filter specifies a set of criteria to match against in removing documents. > db.books.deleteOne({"_id": 3}) 11.What are the data types in MongoDB?
12.When to use MongoDB?You should use MongoDB when you are building internet and bussiness application that need to envolve quickly and scale elegantly.MongoDB is popular with developers of all kinds who are building scalable applications using agile methodologies. MongoDB is a great choice if one needs to :
? |
|
|
上一篇文章 下一篇文章 查看所有文章 |
|
开发:
C++知识库
Java知识库
JavaScript
Python
PHP知识库
人工智能
区块链
大数据
移动开发
嵌入式
开发工具
数据结构与算法
开发测试
游戏开发
网络协议
系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程 数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁 |
360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 | -2024/11/24 10:52:20- |
|
网站联系: qq:121756557 email:121756557@qq.com IT数码 |