MongoDB

MongoDB

Generate Test Data has 10 Questions
Which of the following will implicitly create the collection testData ?

while (var i = 1; i <= 25; i++){

db.testData.insert( { x : i } )

}

for (var i = 1; i <= 25; i++) {

db.testData.insert( { x : i } )

}

for (var i = 1; i <= 25; i++) {

db.testData.inserts( { x : i } )

}

None of the mentioned
Point out the correct statement:

Collection is a group of MongoDB documents
MongoDB is an open-source document database, and leading NoSQL database
Collections do not enforce a schema
All of the mentioned
Which of the following method returns a cursor ?

find
sort
skip
All of the mentioned
Which of the following function is valid for creation of new data inside MongoDB Shell ?

function insertData(dbName, colName, num) {

var col = db.getSiblingDB(dbName).getCollection(colName);

for (i = 0; i < num; i++) { col.insertData({x:i}); }

print(col.count());

}

function insertData(dbName, colName, num) {

var col = db.getSiblingDB(dbName).getCollection(colName);

for (i = 0; i < num; i++) { col.insert({x:i} );

}

print(col.count());

}

insertData(dbName, colName, num) {

var col = db.getSiblingDB(dbName).getCollection(colName);

for (i = 0; i < num; i++) { col.insert({x:i}); }

print(col.count());

}

None of the mentioned
Point out the wrong statement :

Database is a physical container for collections
A single MongoDB server typically has single databases
Collection is the equivalent of an RDBMS table
None of the mentioned
_id is a ________ bytes hexadecimal number which assures the uniqueness of every document:

13
16
12
10
Which of the following statement will insert 400 documents in to the testData collection ?

insertData("test", "testData", 200)
insertData("test", "testData", 400)
insertData("test", "testData", 600)
All of the mentioned
The mongo shell loads and parses the ___________ file on startup.

mongo.js
mongoc.js
mongorc.js
All of the mentioned
To iterate the cursor and return more documents, type _________ in the mongo shell.

cursor
it
next
None of the mentioned
Which of the following key is used to denote uniqueness in the collection?

_id
id
id_
None of the mentioned