- What kind of datastore is MongoDB?
MongoDB is a document-oriented NoSQL datastore - Which format are the documents stored in MongoDB?
Documents are stored in binary form of JSON known as BSON - How can you inspect a source code of a function?
The function must be invoked without any parentheses - Which language is supported by MongoDB for UDF?
Both built-in functions and UDFs are written in JavaScript - What are the different type of indexes supported by MongoDB?
B-Tree index and GeoSpatial index - How is a index created?
An index is created by calling ensureIndex(fields,options) - How will you see the explain plan for a query?
By calling the explain() function. For example, db.book.find().explain() - How will you find if you are on the master server?
Db.isMaster() - How many master does MongoDB allow?
Only one. CouchDB allows multiple masters. - What is the ObjectId composed of?
The ObjectId is composed of timestamp, client machine id, client process id, 3 byte incremented counter - Can documents stored in MongoDB collection vary in structure?
Since MongoDB documents are schemaless they can very in structure - What is the command syntax for inserting a document?
database.collection.insert(document) - From which node are the reads performed by default?
From the primary node by default. - Are transactions supported?
No, classical operations such as insert, update, delete, commit, rollback are not supported - What is master or primary?
A master or primary node in a replica set is where all write operations take place. In the event of primary node failure other node (member) may be elected as primary. - What is a secondary or slave?
A secondary or slave is a node/member which is replicated from actions of primary. The actions are replicated to a slave from primary in an asynchronous fashion. The slave will try to stay as close to the primary as possible. - Why are data files so large in MongoDB?
In order to avoid filesystem fragmentation, MongoDB employs agressive preallocation of reserved space. - How can I see the connection used by mongos?
db._adminCommand("connPoolStats") - What feature I can use to do safe hot backups?
Journaling - What is the role of profiler in MongoDB?
The profiler shows the performance characteristics of each operation against the database.
Thursday, March 13, 2014
MongoDB interview questions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment