0% found this document useful (0 votes)
71 views

Interview Questions About MongoDB

Mongodb question
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Interview Questions About MongoDB

Mongodb question
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

5 Interview Questions about MongoDB

1.What is MongoDB? What is a namespace?


Ans: MongoDB is a document-oriented database that is used for high accessibility,
high performance, and easy scalability. It supports the dynamic schema design. A
namespace is the concatenation of the database name and collection name.
2.What is CRUD in MongoDB?
Ans:

• C – Create: db.collection.insert();
• R – Read: db.collection.find();
• U – Update: db.collection.update();
• D – Delete: db.collection.remove({“fieldname” : ”value”});

3.What is objectId ?

Ans: ObjectId is a class that is the default primary key for the document in
MongoDB. It is found in the _id field of the inserted document. ObjectID is a 12-
byte BSON type. These are:

i.4 bytes value representing seconds


ii.3 byte machine identifier
iii.2 byte process id
iv.3 byte counter

4.What’s a NoSQL Database, What Types Are There, and What Type Is
MongoDB?

Ans: A NoSQL database offers a mechanism for storage and retrieval of data
meant to respond to the unique demands and challenges of today’s modern
applications. NoSQL, which stands for “Not Only SQL” is a departure from the
tabular relations used in relational databases such as SQL and Oracle. Types of
NoSQL databases: a)Document-oriented b)Key-Value Stores c)Graph Stores
d)Wide-Column Stores. MongoDB is the first type, a document-oriented database,
storing data in Binary JSON (BSON) structure-based documents, which in turn are
stored in a collection.
5. What is the difference between MongoDB and MySQL?

Ans: Although MongoDB and MySQL both are free and open source databases,
there is a lot of difference between them in the term of data representation,
relationship, transaction, querying data, schema design and definition,
performance speed, normalization and many more. To compare MySQL with
MongoDB is like a comparison between Relational and Non-relational databases

You might also like