



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A comprehensive overview of different types of nosql databases, with a focus on mongodb. It covers the key features and characteristics of mongodb, including its flexible data model, scalability, and expressive query language. The document also explores topics such as data types, objectid structure, data modeling best practices, aggregation, indexing, sharding, and replication in mongodb. Additionally, it addresses common mongodb operations like inserting, updating, and removing data. The information presented in this document can be valuable for university students studying database systems, software engineering, or cloud computing, as well as for lifelong learners interested in understanding the evolution of database technologies beyond traditional relational databases.
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




What are some different types of NoSQL databases? - Answers -There are four types of NoSQL database: Document store NoSQL database Graph base NoSQL database Key value store NoSQL database A column store NoSQL database What kind of NoSQL database is MongoDB? - Answers -MongoDB is a document oriented database. It stores data in the form of BSON structure based documents. These documents are stored in collections. Compare SQL databases and MongoDB at a high level. - Answers -SQL (relational) databases store data in form of tables, rows and columns. This data is stored in a pre- defined schema which is not very much flexible for today's real-world highly growing applications. MongoDB in contrast uses a flexible document structure which places the responsibility for data modeling mostly on the other parts of the application. A given collection may hold documents with different structure as long as the application is programmed to expect such variation. Which are the most important features of MongoDB? - Answers -- Flexible data model in form of documents (schema-less)
Array Are null values allowed? - Answers -Yes, but only for the members of an object. A null cannot be added to the database collection as it isn't an object. But {}can be added. Explain the structure of ObjectID in MongoDB. - Answers -ObjectID is a 12-byte BSON type with:
What's a Master or Primary? - Answers -This is a node/member which is currently the primary and processes all writes for the replica set. During a failover event in a replica set, a different member can become primary. What's a Secondary or Slave? - Answers -A secondary is a node/member which applies operations from the current primary. This is done by tailing the replication oplog (local.oplog.rs). Replication from primary to secondary is asynchronous, however, the secondary will try to stay as close to current as possible (often this is just a few milliseconds on a LAN). By default, MongoDB writes and reads data from both primary and secondary replica sets. True or False. - Answers -False. MongoDB writes data only to the primary replica set. Should I start out with sharded or with a non-sharded MongoDB environment? - Answers -starting unsharded for simplicity and quick startup unless your initial data set will not fit on single servers. Upgrading to sharding from unsharded is easy and seamless, so there is not a lot of advantage to setting up sharding before your data set is large. How can I see the connections used by mongos? - Answers - db._adminCommand("connPoolStats"); What is Mongoose? - Answers -Mongoose is a MongoDB object modeling tool, or ODM (Object Document Mapper), written in JavaScript and designed to work in an asynchronous environment Is there a way to access the ObjectId constructor from Mongoose? - Answers -Yes, you can find the ObjectId constructor on require('mongoose').Types. Here is an example: var mongoose = require('mongoose'); var id = mongoose.Types.ObjectId(); id is a newly generated ObjectId. What is difference between dependencies and devDependencies? - Answers - dependencies are modules your project depends on. devDependencies are modules you use to develop your project. Examples of dependencies are request, through2 and concat-stream. Examples of devDependencies are grunt, mocha, eslint, tape, and browserify.
When should we embed one document within another in MongoDB? - Answers -You should consider embedding documents for:
mongostat, and/or the MongoDB Management Service (MMS) Specifically, the locks document in the output of serverStatus, or the locks field in the current operation reporting provides insight into the type of locks and amount of lock contention in your mongod instance. To terminate an operation, use db.killOp(). How does MongoDB sort queries in sharded environments? - Answers -If you call the cursor.sort() method on a query in a sharded environment, the mongod for each shard will sort its results, and the mongos merges each shard's results before returning them to the client. How do you determine the size of an index? - Answers -To check the sizes of the indexes on a collection, use db.collection.stats().