What is the output of following two commands in MongoDB: db. posts. insert({n_id":l}) db.posts.insert({"_id":l})

Posted by: Pdfprep Category: C100DBA Tags: , ,

What is the output of following two commands in MongoDB: db. posts. insert({n_id":l}) db.posts.insert({"_id":l})
A . Two documents will be inserted with _id as 1
B . MongoDB will automatically increment the _id of the second document as 2
C . This will throw a duplicate key error
D . It will insert two documents and throw a warning to the user

Answer: C

Leave a Reply

Your email address will not be published.