IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: 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

  1. What is MongoDB ?

  • MongoDB is an open-source NoSQL database written in C++ language.It uses JSON-like documents with optional schemas.
  • It provides easy scalability and is a cross-platform,document-oriented database.
  • MongoDB works on the concept of Collection and Document.
  • It combines the ability to scale out with features such as secondary indexes,range queries,sorting ,aggregations and geospatial indexes.
  • MongoDB is developed by MongoDB Inc.and licensed under the Server Side Public License(SSPL)

2. What are some of the advantages of MongoDB?

Some advantages of MongoDB are as follows:

  • MongoDB supports field,range-based,string-based,string pattern matching type queries.for searching the data in the database
  • MongoDB support primary and secondary index on any fields.
  • MongoDB basically uses JavaScript objects in place of procedures.
  • MongoDB uses a dynamic database schema
  • MongoDB is very easy to scale up or down.
  • MongoDB has inbuilt support for data partitioning (Sharding).

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:

  • admin
  • local
  • config

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?

  • Indexing: It supports generic secondary indexes and provides unique,compound,geospatial,and full-text indexing capabilities as well.
  • Aggregation:It provides an aggregation framework based on the concept of data processing pipelines.
  • Special collection and index types:It supports time-to-live(TTL)collections for data that should expire at a certain time
  • File storage:It supports an easy-to-use protocol for storing large files and file metadata.
  • Sharding:Sharding is the process of spliting data up across machines.

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?

  • Null
  • Boolean
  • Number
  • String
  • Date
  • Regular expression
  • Array
  • Embedded document
  • Object ID
  • Binary Data
  • Code

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 :

  • Support a rapid iterative development.
  • Scale to high levels of read and write traffic - MongoDB supports horizontal scaling through Sharding,distributing data across several machines, and facilitaing high throughput operations with large sets of data.
  • Scale your data repository to a massive size.
  • Evolve the type of deployment as the business changes.
  • Store,manage and search data with text,geospatial,or time-series dimensions.

?

  大数据 最新文章
实现Kafka至少消费一次
亚马逊云科技:还在苦于ETL?Zero ETL的时代
初探MapReduce
【SpringBoot框架篇】32.基于注解+redis实现
Elasticsearch:如何减少 Elasticsearch 集
Go redis操作
Redis面试题
专题五 Redis高并发场景
基于GBase8s和Calcite的多数据源查询
Redis——底层数据结构原理
上一篇文章      下一篇文章      查看所有文章
加:2021-12-03 13:06:19  更:2021-12-03 13:08:46 
 
开发: 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-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码