1.
`rs.add("<hostname>")`
2.
`replicaSetAdd("<hostname>")`
3.
`rs.insert("<hostname>")`
4.
`replica.add("<hostname>")`
Q 1 / 76
1.
restore
2.
backup
3.
mongobackup
4.
mongodump
Q 2 / 76
1.
`db.citizens.select('WHERE age >= 21')`
2.
`db.citizens.where('age >= 21')`
3.
`db.citizens.find('WHERE age >= 21')`
4.
`db.citizens.find({age: {$gte: 21}})`
Q 3 / 76
1.
data
2.
documents
3.
fields
4.
rows
Q 4 / 76
1.
`getDateTime(_id)`
2.
`_id.createDate()`
3.
`_id.getTimestamp()`
4.
`_id.getDateTime()`
Q 5 / 76
1.
myCursor.hasNext()
2.
myCursor.sort()
3.
myCursor.next()
4.
myCursor.find()
Q 6 / 76
1.
`db.users.find({_id: 1})`
2.
`db.users.seek({_id: 1})`
3.
`db.users.query({_id: 1})`
4.
`db.query.users({_id: 1})`
Q 7 / 76
1.
`--type jsonArray`
2.
`--json`
3.
`--type json`
4.
`--jsonArray`
Q 8 / 76
1.
mongo
2.
mongod
3.
mongoconnect
4.
dbconnect
Q 9 / 76
1.
db.customers.find({lastName: 'smith'}).explain()
2.
db.customers.find({lastName: 'smith'}).perf()
3.
db.customers.find({lastName: 'smith'}).plan()
4.
db.customers.find({lastName: 'smith'}).usedIndex()
Q 10 / 76
1.
Set useMemory to twice amount indicated in exception.
2.
Switch a 64 bit instance of MongoDB.
3.
Increase the memory of the MongoDB server.
4.
Set allowDiskUse to true.
Q 11 / 76
1.
db.deleteUser("user")
2.
db.removeUser("user") DEPRECATED
3.
db.remove("user")
4.
db.dropUser("user")
Q 12 / 76
1.
once the primary has been down for 10 minutes
2.
once the primary reboots
3.
immediately
4.
after the administrator reboots the primary
Q 13 / 76
1.
`--setParameter authenticationMechanisms=GSSAPI`
2.
`--setAuthentication=GSSAPI`
3.
`--setParam auth=K`
4.
`--setAuth method=Kerberos`
Q 14 / 76
1.
It monitors replica set and sends email in case of failure
2.
It casts the tie-breaking vote in an election.
3.
It holds a backup copy of the database.
4.
It reboots the failed server.
Q 15 / 76
1.
`db.product.group({_id: "$category", count: {$sum:1}})`
2.
`db.product.aggregate($sum: {_id: "$category", count: {$group:1}})`
3.
`db.product.aggregate($group: {_id: "$category", count: {$sum:1}})`
4.
`db.product.aggregate($count: {_id: "$category", count: {$group:1}})`
Q 16 / 76
1.
take
2.
limit
3.
max
4.
skip
Q 17 / 76
1.
`db.restaurants.CreateIndex({location: "2dsphere"})`
2.
`db.restaurants.geospatial({location: "2dsphere"})`
3.
`db.restaurants.CreateIndex("2dsphere":"location")`
4.
`db.restaurants.CreateIndex({geospatial: "location"})`
Q 18 / 76
1.
`db.customers.findmatch ({"jobs":"secretary"})`
2.
`db.customers.find ({"jobs:secretary"})`
3.
`db.customers.find ({"jobs":["secretary"]})`
4.
`db.customers.find ({"jobs":"secretary"})`
Q 19 / 76
1.
`db.customers.find({}, {skip: 5, limit: 10})`
2.
`db.customers.find({}.page(5).take(10))`
3.
`db.customers.find({}).skip(5).take(10)`
4.
`db.customers.find({}).skip(5).limit(10)`
Q 20 / 76
1.
`db.customers.createIndex({firstName, lastName})`
2.
`db.customers.createTextIndex({firstName, lastName})`
3.
`db.customers.createIndex({firstName: "text", lastName: "text"})`
4.
`db.customers.createText({firstName: 1, lastName: 1})`
Q 21 / 76
1.
`db.customers.createIndex("lastName, firstName, ASC")`
2.
`db.customers.addIndex({lastName:"ASC", firstName: "ASC"})`
3.
`db.customers.newIndex({lastName:1, firstName:1})`
4.
`db.customers.createIndex({lastName:1, firstName: 1})`
Q 22 / 76
1.
Set the replace option to true.
2.
Use the replaceOne() command instead.
3.
You can't. Once set, the _id field cannot be changed.
4.
Use the updateOne() command instead.
Q 23 / 76
1.
Calculate interest quickly.
2.
Accomplish nothing, since compound indexes aren't allowed in Mongo.
3.
Use more than one field per index.
4.
Combine fields in different collations.
Q 24 / 76
1.
They do not have to use the same operators.
2.
You do not need to structure the database to support them.
3.
They autogenerate reports.
4.
They run faster than indexed queries.
Q 25 / 76
1.
every 2 minutes
2.
every 5 seconds
3.
every 2 seconds
4.
every 10 seconds
Q 26 / 76
1.
`db.customers.all();`
2.
`db.find().customers();`
3.
`db.customers.find();`
4.
`db.customers.show();`
Q 27 / 76
1.
`myCursor.stats()`
2.
`myCursor.dump()`
3.
`myCursor.info()`
4.
`myCursor.explain()`
Q 28 / 76
1.
They speed up read access while slowing down writes.
2.
They secure the database from intruders.
3.
They speed up reads and writes.
4.
They speed up write access while slowing down reads.
Q 29 / 76
1.
Latitude, longitude
2.
XML
3.
GeoJSON
4.
BSON
Q 30 / 76
1.
Python
2.
JavaScript
3.
SQL
4.
TypeScript
Q 31 / 76
1.
Create a text index on each field.
2.
MongoDB is not able to do this.
3.
Create a compound text index using both fields.
4.
Create a text index on one field and a single field index on the other.
Q 32 / 76
1.
mongorestore
2.
mongoi
3.
upload
4.
mongoimport
Q 33 / 76
1.
access the database
2.
be called only when the key has a single value
3.
access the database only to perform read operations
4.
not access the data
Q 34 / 76
1.
the name field
2.
the ObjectId field
3.
the `_id` field
4.
no field will have an index
Q 35 / 76
1.
limit, skip, sort
2.
sort, limit, skip
3.
limit, sort, skip
4.
sort, skip, limit
Q 36 / 76
1.
`db.vehicle.stats(1024)`
2.
`db.vehicle.stats("kilobytes")`
3.
`db.vehicle.stats(true)`
4.
`db.vehicle.stats("kb")`
Q 37 / 76
1.
Use the `reIndex()` command to modify the index.
2.
Delete the original index and create a new index.
3.
Call the `createIndex()` command with the update option.
4.
Use the `updateIndex()` command.
Q 38 / 76
1.
`db.vehicle.dropIndex("description_text")`
2.
`db.vehicle.dropIndex({"description":"text"})`
3.
`db.vehicle.removeIndex({"description":"text"})`
4.
`db.vehicle.removeIndex("description_text")`
Q 39 / 76
Note: count() works with find(...) but length works with distinct
1.
`db.vehicle.distinct("category")`
2.
`db.vehicle.unique("category")`
3.
`db.vehicle.distinct("category").count()`
4.
`db.vehicle.distinct("category").length`
Q 40 / 76
1.
`db.customers.add({name: "Bob"})`
2.
`db.customers.save({name: "Bob"})`
3.
`db.customers.create({name: "Bob"})`
4.
`db.customers.new({name: "Bob"})`
Q 41 / 76
1.
`_id`
2.
`_name`
3.
ObjectId
4.
mongoDB is schema-less so no field is required
Q 42 / 76
1.
data, namespace, and journal
2.
namespace, journal, and log
3.
journal, data, and database
4.
data, log, and journal
Q 43 / 76
1.
`db.persons.find().sort({lastName: -1}}`
2.
`db.persons.find().sort({lastName: 1}}`
3.
`db.persons.find().sort({lastName: ascending}}`
4.
`db.persons.find().sort({lastName: $asc}}`
Q 44 / 76
1.
restore
2.
read/write
3.
dbadmin
4.
delete collections
Q 45 / 76
1.
`db.customers.delete({_id: 1});`
2.
`db.customers.drop({_id: 1});`
3.
`db.drop.customers({_id: 1});`
4.
`db.customers.remove({_id: 1});`
Q 46 / 76
1.
`db.customers.remove({}).indexes();`
2.
`db.customers.remove({});`
3.
`db.customers.drop();`
4.
`db.customers.delete();`
Q 47 / 76
1.
primary
2.
arbiter
3.
secondary
4.
backup
Q 48 / 76
1.
`db.people.getName();`
2.
`db.people.reIndex({names: 1});`
3.
`db.people.getIndexKeys();`
4.
`db.people.getIndexes();`
Q 49 / 76
1.
Use the replaceMany() command instead
2.
Use the updateMulti() command instead
3.
Use the updateMany() command instead
4.
Set the global multi option to True
Q 50 / 76
1.
quit()
2.
exit()
3.
db.shutdownServer()
4.
db.shutdown()
Q 51 / 76
1.
`db.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}, {$sort :{number: -1}}])`
2.
`db.members.find({$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}.$sort ({number: -1})`
3.
`db.members.find([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number: {$sum: 1}}}, {$sort :{number: -1}}])`
4.
`db.members.aggregate([ {$match: {gender: "Female"}}, {$sort :{number: -1}}])`
Q 52 / 76
1.
wireTiger mode
2.
executionStats mode
3.
queryPlanner mode
4.
allPlansExecution mode
Q 53 / 76
1.
`db.person.find({exists: 'homePhone'});`
2.
`db.person.exists({homePhone: true});`
3.
`db.person.find({homePhone: {$exists: true}});`
4.
`db.person.has('homePhone');`
Q 54 / 76
1.
mongodb
2.
mongo-daemon
3.
daemon
4.
mongod
Q 55 / 76
1.
Restart the `mongod` process.
2.
Issue the `secure()` command.
3.
Issue the `mongoimport` command.
4.
Issue the `authenticate()` command.
Q 56 / 76
1.
MongoDB does not allow ad hoc queries; all queries require an index.
2.
Ad hoc queries are allowed only in the paid version.
3.
Ad hoc queries are allowed only through the ad hoc command.
4.
MongoDB allows ad hoc queries.
Q 57 / 76
1.
allows you to do a calculation on the results
2.
allows you to run queries on the server
3.
allows you to select which fields should be in the return data
4.
allows you to format the results for a display
Q 58 / 76
1.
`dropDatabase()`
2.
`removeAll()`
3.
`clear()`
4.
`deleteDatabase()`
Q 59 / 76
1.
`-db=null`
2.
`--shell-only`
3.
`--free`
4.
`-nodb`
Q 60 / 76
1.
`Use db.collection.set({$_id:pretty})`
2.
`Create a second index`
3.
`Use db.collection.format(numeric)`
4.
`Use $_id = value`
Q 61 / 76
1.
`The oplog will be saved on one of the secondary servers.`
2.
`The oplog is capped collection and can't run out of memory`
3.
`The MongoDB instance will fail`
4.
`The oplog will stop recording logging information`
Q 62 / 76
1.
mongo
2.
mongo-s
3.
shell
4.
mongo-shell
Q 63 / 76
1.
`db.performance.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id:{city:"$city"}, number: {$sum: 1}}}, {$sort : {number: -1}}])`
2.
`db.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number:{$sum:1}}}, {$sort: {number:-1}}]).explain("executionStats")`
3.
`db.members.aggregate([ {$match: {gender: "Female"}}, {$group:{_id: {city: "$city"}, number: {$sum: 1}}}, {$sort: {number: -1}}]).explain()`
4.
`db.members.aggregate([ {$match: {gender: """Female"""}}, {$group: {_id: {city: """$city"""}, number: {$sum:1}}}, {$sort: {number: -1}}]).number()`
Q 64 / 76
1.
node 'list.js'
2.
exec('list.js)
3.
run('list.js)
4.
load('list.js)
Q 65 / 76
1.
db.customers.sort({name: -1}.find({})
2.
db.customers.sort({name: -1})
3.
db.customers.find({}).sort({name: -1})
4.
db.customers.find({}).sort({name: 1})
Q 66 / 76
1.
The import command aborts without importing any records.
2.
The import command imports records upto but not including the record, and then aborts.
3.
The import command doesn't import the bad document but does import the rest.
4.
The import command prompts you to correct the bad record.
Q 67 / 76
1.
Use the purge operator before the sort.
2.
Return the entire collection and sort on the client.
3.
Pass the --more-memory option.
4.
Create an index on the field you are sorting.
Q 68 / 76
1.
Create a text index on the field and do a $text Query.
2.
Create an single field index in descending order, and do a query for the word.
3.
Do a $text query.
4.
Create a $regex on the fields, and do a $regex query.
Q 69 / 76
1.
index
2.
Name
3.
`_id`
4.
row number
Q 70 / 76
1.
Create a user account.
2.
Register online.
3.
Create a data directory.
4.
Establish security credentials.
Q 71 / 76
1.
as a properly formatted JSON array
2.
as YAML
3.
as plain text
4.
as a BSON object
Q 72 / 76
1.
db.size()
2.
db.info()
3.
db.memory()
4.
db.stats()
Q 73 / 76
1.
db.createUser({})
2.
db.insert({user: 1})
3.
db.customers.newUser({})
4.
db.newUser({})
Q 74 / 76
1.
JSON (JavaScript Object Notation)
2.
BSON (Binary JSON)
3.
ORM (object relational mode)
4.
MBF (MongoDB binary format)
Q 75 / 76
1.
`db.customers.find({}, {firstName: 1, lastName: 1})`
2.
`db.customers.find({}, {_id:0, firstName: 1, lastName: 1})`
3.
`db.customers.find({_id: 0, year: 1, maek: 1, model: 1})`
4.
`db.customers.find({}).project({firstName: 1, lastName: 1})`
Q 76 / 76