adplus-dvertising
frame-decoration

Question

Which of the following will implicitly create the collection testData?

a.

while (var i = 1; i <= 25; i++)
{
db.testData.insert( { x : i } )
}

b.

for (var i = 1; i <= 25; i++)
{
db.testData.insert( { x : i } )
}

c.

for (var i = 1; i <= 25; i++)
{
db.testData.inserts( { x : i } )
}

d.

None of the mentioned

Answer: (b).for (var i = 1; i <= 25; i++)
{
db.testData.insert( { x : i } )
}

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following will implicitly create the collection testData?

Similar Questions

Discover Related MCQs

Q. Point out the correct statement.

Q. Which of the following method returns a cursor?

Q. Which of the following function is valid for creation of new data inside MongoDB Shell?

Q. Point out the wrong statement.

Q. _id is a ________ bytes hexadecimal number which assures the uniqueness of every document.

Q. Which of the following statement will insert 400 documents in to the testData collection?

Q. The mongo shell loads and parses the ___________ file on startup.

Q. To iterate the cursor and return more documents, type _________ in the mongo shell.

Q. Which of the following key is used to denote uniqueness in the collection?

Q. A query may include a ___________ that specifies the fields from the matching documents to return.

Q. Point out the correct statement.

Q. MongoDB stores all documents in _____________

Q. In MongoDB _________ operations modify the data of a single collection.

Q. Point out the wrong statement.

Q. Which of the following operation adds a new document to the users collection?

Q. Which of the following preference determines how the client direct read operations to the set?

Q. Applications can also control the behavior of write operations using _______ concern.

Q. MongoDB process collection of documents using _________ operations.

Q. Which of the following pipeline is used for aggregation in MongoDB?

Q. The order of documents returned by a query is not defined unless you specify a ______