SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
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. Returns help information for a command.
document
db.commandHelp("commandName")
Update Modifiers
$mod
2. Returns all the documents matching the optional properties.
db.commandHelp("commandName")
$elemMatch
db.<collection>.find([properties]);
key.index
3. Standard binary data type.
string
db.getLastError()
boolean
$or
4. Command to get help docs on a specific command at the collection level.
64-Bit Integer
db.<col>.help([commandName]);
$mod
mongo
5. Operator allowing the partial specification of fields in an embedded document in an array.
BSON
mongo
$elemMatch
db.<collection>.findOne([properties]);
6. Updates all matching documents, not just the first, that match the selector.
Multi-updates
$size
db.<col>.update({selector},{document});
mongo
7. Greater than query conditional. ex: db.<col>.find({numVal: {$gt:3}});
$pull
$or
regular expression
$gt
8. 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.
Upsert
db.<col>.update({selector},{document});
db.<col>.remove({selector});
db.myCollection.ensureIndex({keypattern},[{options}])
9. Unique 12-byte ID for documents.
$or
binary data
BSON
object id
10. Contains query conditional used to check if a value contains the field value.
db.myCollection.ensureIndex({keypattern},[{options}])
db.help([commandName]);
$mod
$in
11. Creates an index on property(s). Options can describe the type of sorting, uniqueness, etc.
object id
$in
db.myCollection.ensureIndex({keypattern},[{options}])
db.help([commandName]);
12. Clone the current database (implied by 'db') from another host.
db.cloneDatabase(fromhost)
db.<col>.help([commandName]);
$mod
mongod
13. Returns help information for a command.
db.commandHelp("commandName")
show collections
db.myCollection.ensureIndex({keypattern},[{options}])
batch insert
14. 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"}});
key.index
$set
$push
mongod
15. Array specific conditional allowing matching on multiple elements within an array. The operation is non strict on the sequence of the values in the passed selector array.
db.cloneDatabase(fromhost)
$all
db.commandHelp("commandName")
show collections
16. 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.
Cursor
db.runCommand({fsync:1,lock:1,async:1})
db.commandHelp("commandName")
db.help([commandName]);
17. Query conditional allowing the selector to choose between more than one optional criteria.
db.getLastError()
$or
null
maximum value
18. Operator used in the second argument of the find() call to specify which slice of an array to return for an array field.
minimum value
help
document
$slice
19. Adds a document to a collection.
64-Bit Integer
null
db.<collection>.insert({document});
$nin
20. Returns one document matching the optional properties.
$in
$gt
undefined
db.<collection>.findOne([properties]);
21. Adds a value to the array only if its not in the array already. Otherwise, if the field is not present, it sets the field to the array value. ex: { $addToSet : { a : { $each : [ 3 , 5 , 6 ] } } }
db.getLastError()
$addToSet
$elemMatch
Update Modifiers
22. Does not contain query conditional used to select documents with the field that is not in the selector list of values.
db.<collection>.insert({document});
db.<col>.help([commandName]);
$nin
binary data
23. Meta query conditional used to negate the selector.
mongo
$gt
$not
null
24. ...
db.runCommand({fsync:1,lock:1,async:1})
$lte
undefined
batch insert
25. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
$set
db.<collection>.insert({document});
db.cloneDatabase(fromhost)
32-Bit Integer
26. Data structure used to store all other data in mongo databases.
mongod
$gt
document
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
27. 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.
$ne
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
binary data
code
28. Javascript code. Documents can contain code as values.
code
64-bit floating point numbers
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
use <database name>
29. Standard javascript regular expressions. These can be stored in documents
regular expression
mongo
Update Modifiers
undefined
30. Array specific conditional used to select based on the length or set-size of an array field value.
$pull
$pop
show collections
$size
31. Deletes a given field. ex: { $unset : { field : 1} }
$size
batch insert
Upsert
$unset
32. Removes all occurrences of a value from a field. ex: { $pull : { field : _value } }
document
Cursor
$pull
32-Bit Integer
33. In BSON - represents the smallest possible value.
Object.bsonsize({document});
$unset
minimum value
undefined
34. Operator allowing the execution of arbitrary javascript as part of the selector.
mongo
$or
$where
db.myCollection.ensureIndex({keypattern},[{options}])
35. Clone the current database (implied by 'db') from another host.
db.cloneDatabase(fromhost)
$pull
$inc
null
36. Adds a document to a collection.
show collections
db.<collection>.insert({document});
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
$in
37. command to start the mongodb process.
64-bit floating point numbers
$inc
mongod
Upsert
38. Renames a field from the one indicated to the new field name. ex: { $rename : { old_field_name : new_field_name } }
db.<col>.update({selector},{document});
db.myCollection.ensureIndex({keypattern},[{options}])
$size
$rename
39. changes the database on which you are working.
use <database name>
$addToSet
document
minimum value
40. Stored as milliseconds since the epoch.
$lt
date
db.myCollection.ensureIndex({keypattern},[{options}])
help
41. 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 } }
$pop
Multi-updates
$push
db.getLastError()
42. Removes all occurrences of each value in the passed in array from the field. ex: { $pullAll : { field : value_array } }
$lte
maximum value
64-Bit Integer
$pullAll
43. Less than or equal query conditional. ex: db.<col>.find({numVal: {$lte:3}});
$pushAll
$lte
$inc
BSON
44. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
$rename
$or
64-Bit Integer
minimum value
45. Deletes documents from the collection based on the selector.
code
db.<col>.remove({selector});
batch insert
64-Bit Integer
46. String of arbitrary bytes.
64-Bit Integer
db.cloneDatabase(fromhost)
binary data
$push
47. Set or list of values.
$or
$where
help
array
48. Less than query conditional. ex: db.<col>.find({numVal: {$lt:3}});
$size
$lt
$unset
mongod
49. Used to represent both a null value and a nonexistent field.
$lt
$pushAll
null
binary data
50. Syntax used for selectors to be specific to a certain element position within an array.
$pop
key.index
$not
$in