SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
Search
Test your basic knowledge |
Mongo Db
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Command to get help docs on a specific command at the collection level.
32-Bit Integer
db.cloneDatabase(fromhost)
batch insert
db.<col>.help([commandName]);
2. Contains query conditional used to check if a value contains the field value.
db.<collection>.findOne([properties]);
$in
binary data
$all
3. Removes all occurrences of each value in the passed in array from the field. ex: { $pullAll : { field : value_array } }
$size
$pullAll
BSON
db.<collection>.insert({document});
4. Update call that inserts a new document if no update match is found. Allows the same code to be used for inserts as well as updates.
$in
db.getLastError()
db.commandHelp("commandName")
Upsert
5. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
64-Bit Integer
db.runCommand({fsync:1,lock:1,async:1})
date
db.<collection>.find([properties]);
6. Operator used in the second argument of the find() call to specify which slice of an array to return for an array field.
$elemMatch
Cursor
$slice
db.help([commandName]);
7. In BSON - represents the largest possible value.
$gte
maximum value
$lt
$or
8. Copies an entire database from one name on one server to another name on another server. Omit frmHostName to copy from one name to another on the same server.
show collections
$gt
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
db.<collection>.insert({document});
9. command to start the mongodb process.
maximum value
mongod
Object.bsonsize({document});
$rename
10. Returns the size of a document after it is converted to BSON from the JSON-like original.
db.cloneDatabase(fromhost)
$in
Object.bsonsize({document});
$lt
11. Not equal query conditional. ex: db.<col>.find({numVal: {$ne:3}});
$ne
$in
date
object id
12. Binary-encoded serialization of mongo documents.
string
BSON
db.<collection>.insert({document});
mongod
13. Removes all occurrences of a value from a field. ex: { $pull : { field : _value } }
regular expression
db.<col>.remove({selector});
$in
$pull
14. Standard binary data type.
$rename
db.commandHelp("commandName")
regular expression
boolean
15. Operator allowing the execution of arbitrary javascript as part of the selector.
db.myCollection.ensureIndex({keypattern},[{options}])
db.<collection>.insert({document});
$inc
$where
16. Returns one document matching the optional properties.
64-bit floating point numbers
db.<collection>.findOne([properties]);
db.cloneDatabase(fromhost)
db.<collection>.insert({document});
17. Returns information about the last operation. Not necessarily error data - the return can contain things like number of records updated.
binary data
64-bit floating point numbers
maximum value
db.getLastError()
18. Less than query conditional. ex: db.<col>.find({numVal: {$lt:3}});
db.<collection>.findOne([properties]);
$push
64-bit floating point numbers
$lt
19. Standard javascript regular expressions. These can be stored in documents
db.help([commandName]);
Cursor
$not
regular expression
20. Deletes documents from the collection based on the selector.
$lte
db.<collection>.find([properties]);
db.<col>.remove({selector});
mongod
21. Adds a document to a collection.
embedded document
$rename
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
db.<collection>.insert({document});
22. Update modifier used to increment a value. ex: {"$inc":{"counter":2}}
db.<collection>.find([properties]);
use <database name>
$inc
$or
23. changes the database on which you are working.
mongo
use <database name>
mongod
undefined
24. command to start the mongodb process.
Object.bsonsize({document});
64-Bit Integer
mongod
$ne
25. set of UTF-8 characters.
use <database name>
64-bit floating point numbers
$slice
string
26. Appends a value to field - if the field is an existing array. Otherwise it sets the field to the array [value] if field is not present. ex: { $push : { field : value } }
db.cloneDatabase(fromhost)
$push
64-Bit Integer
$gte
27. Command to list commands and descriptions of those commands in the context of the database.
$
date
help
$where
28. The local variable representation of a query. Uniquely - the cursor does not hold the results but instead access to the results.
db.commandHelp("commandName")
db.<collection>.findOne([properties]);
Cursor
$in
29. Returns all the documents matching the optional properties.
db.<collection>.find([properties]);
undefined
db.cloneDatabase(fromhost)
db.<collection>.findOne([properties]);
30. Updates all matching documents, not just the first, that match the selector.
mongo
minimum value
Multi-updates
maximum value
31. Command to get help docs on a specific command at the db level.
db.help([commandName]);
$set
db.commandHelp("commandName")
$mod
32. command to start the mongo shell.
Update Modifiers
mongo
$lte
BSON
33. Flushes all pending writes to data files. The lock option allows one to safely snapshot the database's data files. The async option returns focus to the console immediately while the task runs in the background.
$not
db.runCommand({fsync:1,lock:1,async:1})
array
$size
34. Used to represent both a null value and a nonexistent field.
null
$addToSet
$not
$ne
35. Update modifier that set the value of a key and if the key does not exist, it will create the key. ex: db.<col>.update({selector},{"$set":{"someKey":"someValue"}});
db.help([commandName]);
$set
db.<collection>.insert({document});
undefined
36. Update a document in the collection.
db.<col>.update({selector},{document});
$elemMatch
use <database name>
null
37. Array specific conditional used to select based on the length or set-size of an array field value.
Update Modifiers
$where
embedded document
$size
38. Stored as milliseconds since the epoch.
$or
$push
maximum value
date
39. changes the database on which you are working.
show collections
BSON
$addToSet
use <database name>
40. Used to describe a variable as not having been initialized.
undefined
$inc
db.<col>.remove({selector});
db.commandHelp("commandName")
41. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
$pushAll
$gte
$in
32-Bit Integer
42. Less than or equal query conditional. ex: db.<col>.find({numVal: {$lte:3}});
$lte
Object.bsonsize({document});
Update Modifiers
db.commandHelp("commandName")
43. String of arbitrary bytes.
$ne
Cursor
date
binary data
44. Removes an element from an array based on the value of the field option being 1 or -1 for last or first element respectively. ex: { $pop : { field : -1 } }
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
$pop
$
key.index
45. Meta query conditional used to negate the selector.
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
$not
document
object id
46. Deletes a given field. ex: { $unset : { field : 1} }
$unset
null
string
$gte
47. Returns help information for a command.
Cursor
$
db.commandHelp("commandName")
minimum value
48. Set or list of values.
db.cloneDatabase(fromhost)
mongo
embedded document
array
49. Returns all the documents matching the optional properties.
db.<collection>.find([properties]);
BSON
db.getLastError()
$inc
50. Lists all the collections in the database in use.
regular expression
show collections
string
embedded document