Showing posts with label MongoDB. Show all posts
Showing posts with label MongoDB. Show all posts

January 28, 2020

#MongoDB Part 6: Interview Questions And Answers

How to create User and add Role in MongoDB?
Creating Admin User
We can create a user administrator in MongoDB by using the createUser method. e.g:

db.createUser(
{
   user: "myadmin",
   pwd: "password@123",
   roles:[{role: "userAdminAnyDatabase", db:"admin"}]
});

January 27, 2020

#MongoDB Part 5: Interview Questions And Answers

What is Mongo shell?
Mongo shell is a JavaScript interface to MongoDB that can be used to query and update data. It is interactive and can also be used to do administrative operations.

What is BSON?
BSON or binary JSON is the binary encoded format of JSON. It extends JSON and provides more data types and fields.

#MongoDB Part 4: Interview Questions And Answers

What is Namespace in MongoDB?
MongoDB stores BSON (Binary Interchange and Structure Object Notation) objects in the collection. The concatenation of the collection name and database name is called a namespace.

#MongoDB Part 3: Interview Questions And Answers

How to query a document in MongoDB using find()?
db.collection.find () is used for retrieval of documents from a MongoDB database. The find command is an in-built function which is used to retrieve the documents in the collection.

#MongoDB Part 2: Interview Questions And Answers

How to create Database and Collection in MongoDB?
In MongoDB, the database is used to store all of the collections, and the collection in turn is used to store all of the documents. The documents contain the relevant Field name and Field values.

#MongoDB Part 1: Interview Questions And Answers

What is MongoDB?
MongoDB is a document-oriented NoSQL database used for high volume data storage.
Instead of using tables and rows as in the traditional relational databases, MongoDB makes use of collections and documents. Documents consist of key-value pairs which are the basic unit of data in MongoDB. Collections contain sets of documents and function which is the equivalent of relational database tables.

July 01, 2019

CAP Theorem

CAP theorem (also known as Eric Brewers theorem) states that we can only achieve at most two out of three guarantees for a database: Consistency, Availability and Partition Tolerance.