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. Javascript code. Documents can contain code as values.
db.<collection>.find([properties]);
db.myCollection.ensureIndex({keypattern},[{options}])
db.runCommand({fsync:1,lock:1,async:1})
code
2. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
mongo
db.<collection>.find([properties]);
32-Bit Integer
$slice
3. Binary-encoded serialization of mongo documents.
$in
BSON
db.myCollection.ensureIndex({keypattern},[{options}])
$size
4. Meta query conditional used to negate the selector.
help
$not
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
$mod
5. In BSON - represents the largest possible value.
$addToSet
$pop
maximum value
boolean
6. Set or list of values.
help
array
use <database name>
$lt
7. 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.
$
$in
db.runCommand({fsync:1,lock:1,async:1})
boolean
8. command to start the mongodb process.
Object.bsonsize({document});
Multi-updates
mongod
$mod
9. Returns all the documents matching the optional properties.
$addToSet
Cursor
db.<collection>.find([properties]);
db.runCommand({fsync:1,lock:1,async:1})
10. 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"}});
use <database name>
regular expression
db.cloneDatabase(fromhost)
$set
11. Returns the size of a document after it is converted to BSON from the JSON-like original.
$pull
Object.bsonsize({document});
$pushAll
db.runCommand({fsync:1,lock:1,async:1})
12. Greater than or equal query conditional. ex: db.<col>.find({numVal: {$gte:3}});
maximum value
null
array
$gte
13. Clone the current database (implied by 'db') from another host.
object id
$pull
db.cloneDatabase(fromhost)
db.myCollection.ensureIndex({keypattern},[{options}])
14. Used to describe a variable as not having been initialized.
string
Upsert
undefined
db.<collection>.findOne([properties]);
15. Greater than query conditional. ex: db.<col>.find({numVal: {$gt:3}});
db.cloneDatabase(fromhost)
$gt
string
db.runCommand({fsync:1,lock:1,async:1})
16. Clone the current database (implied by 'db') from another host.
db.cloneDatabase(fromhost)
db.<collection>.insert({document});
key.index
use <database name>
17. Operator allowing the partial specification of fields in an embedded document in an array.
db.commandHelp("commandName")
Multi-updates
key.index
$elemMatch
18. Not equal query conditional. ex: db.<col>.find({numVal: {$ne:3}});
$ne
$lt
db.myCollection.ensureIndex({keypattern},[{options}])
$push
19. Renames a field from the one indicated to the new field name. ex: { $rename : { old_field_name : new_field_name } }
$rename
code
64-Bit Integer
$lt
20. In BSON - represents the smallest possible value.
$
$not
mongo
minimum value
21. command to start the mongo shell.
mongo
$mod
show collections
db.getLastError()
22. Positional operator that holds the position of the first matched array item in the query. Used to find an array member and then manipulate it. ex: {$inc:{'comments.$.votes':1}} where comments looks like: "comments" : [ { "by" : "joe", "votes" : 3 },
Object.bsonsize({document});
$
$pull
$gte
23. 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
$all
db.getLastError()
24. Command to get help docs on a specific command at the db level.
BSON
db.<col>.update({selector},{document});
batch insert
db.help([commandName]);
25. Does not contain query conditional used to select documents with the field that is not in the selector list of values.
$nin
$set
document
boolean
26. Data structure used to store all other data in mongo databases.
$nin
$inc
document
mongo
27. ...
$inc
batch insert
$lte
$addToSet
28. changes the database on which you are working.
use <database name>
db.<collection>.findOne([properties]);
binary data
$not
29. Operator used in the second argument of the find() call to specify which slice of an array to return for an array field.
$slice
Cursor
null
BSON
30. String of arbitrary bytes.
binary data
$or
$size
show collections
31. 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.<col>.help([commandName]);
$lt
Cursor
$all
32. 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 } }
64-bit floating point numbers
object id
$ne
$pop
33. Syntax used for selectors to be specific to a certain element position within an array.
key.index
$gte
$pull
mongod
34. Unique 12-byte ID for documents.
object id
$push
$ne
binary data
35. Standard javascript regular expressions. These can be stored in documents
$pop
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
regular expression
db.myCollection.ensureIndex({keypattern},[{options}])
36. command to start the mongodb process.
mongod
$unset
db.<col>.remove({selector});
$not
37. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
64-Bit Integer
db.<col>.remove({selector});
64-bit floating point numbers
$elemMatch
38. Returns help information for a command.
64-bit floating point numbers
binary data
db.commandHelp("commandName")
code
39. Stored as milliseconds since the epoch.
64-bit floating point numbers
$in
date
mongod
40. Deletes documents from the collection based on the selector.
regular expression
null
db.<col>.remove({selector});
Cursor
41. Less than or equal query conditional. ex: db.<col>.find({numVal: {$lte:3}});
BSON
$lte
db.cloneDatabase(fromhost)
$set
42. Deletes documents from the collection based on the selector.
use <database name>
$unset
mongod
db.<col>.remove({selector});
43. Removes all occurrences of a value from a field. ex: { $pull : { field : _value } }
$mod
$pull
mongo
show collections
44. Special keys passed in an update call to specify complex update operations - such as alter - adding - or removing keys - and even manipulating arrays and embedded documents.
db.<collection>.find([properties]);
$push
db.help([commandName]);
Update Modifiers
45. Adds a document to a collection.
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
db.<collection>.insert({document});
Object.bsonsize({document});
undefined
46. Returns all the documents matching the optional properties.
string
mongo
$size
db.<collection>.find([properties]);
47. Command to get help docs on a specific command at the collection level.
binary data
date
$gt
db.<col>.help([commandName]);
48. Command to list commands and descriptions of those commands in the context of the database.
$slice
help
mongo
$nin
49. Returns help information for a command.
date
regular expression
db.commandHelp("commandName")
code
50. Returns one document matching the optional properties.
$gte
minimum value
db.<collection>.findOne([properties]);
code