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 all the documents matching the optional properties.
db.<collection>.find([properties]);
help
array
batch insert
2. Updates all matching documents, not just the first, that match the selector.
$push
object id
help
Multi-updates
3. Less than or equal query conditional. ex: db.<col>.find({numVal: {$lte:3}});
$lte
$in
db.<col>.update({selector},{document});
minimum value
4. 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 ] } } }
$where
embedded document
$addToSet
array
5. Used to represent both a null value and a nonexistent field.
array
Multi-updates
$push
null
6. Standard binary data type.
embedded document
db.<collection>.find([properties]);
db.<col>.help([commandName]);
boolean
7. 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
$pullAll
db.<collection>.insert({document});
32-Bit Integer
8. Removes all occurrences of a value from a field. ex: { $pull : { field : _value } }
code
db.help([commandName]);
db.<collection>.insert({document});
$pull
9. Deletes documents from the collection based on the selector.
db.<col>.remove({selector});
$ne
null
$nin
10. Appends each value in the value_array to the field - if field is an existing array. Otherwise - it sets the field to the array value_array - if field is not present ex: { $pushAll : { field : value_array } }
$pushAll
minimum value
db.<collection>.find([properties]);
$size
11. 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.
64-bit floating point numbers
boolean
Update Modifiers
$in
12. In BSON - represents the largest possible value.
db.<col>.remove({selector});
use <database name>
maximum value
db.commandHelp("commandName")
13. Operator allowing the execution of arbitrary javascript as part of the selector.
embedded document
batch insert
$inc
$where
14. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
db.getLastError()
undefined
$or
32-Bit Integer
15. 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 } }
$push
$pushAll
db.commandHelp("commandName")
batch insert
16. Command to list commands and descriptions of those commands in the context of the database.
$slice
boolean
help
binary data
17. Removes all occurrences of each value in the passed in array from the field. ex: { $pullAll : { field : value_array } }
$set
regular expression
$pullAll
64-bit floating point numbers
18. Creates an index on property(s). Options can describe the type of sorting, uniqueness, etc.
db.myCollection.ensureIndex({keypattern},[{options}])
mongo
embedded document
regular expression
19. Deletes a given field. ex: { $unset : { field : 1} }
use <database name>
null
db.help([commandName]);
$unset
20. Contains query conditional used to check if a value contains the field value.
$in
db.runCommand({fsync:1,lock:1,async:1})
null
db.commandHelp("commandName")
21. 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.myCollection.ensureIndex({keypattern},[{options}])
$addToSet
regular expression
22. Deletes documents from the collection based on the selector.
$slice
db.<col>.remove({selector});
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
$where
23. Returns help information for a command.
array
db.commandHelp("commandName")
$where
db.<collection>.findOne([properties]);
24. Command to get help docs on a specific command at the db level.
db.<col>.remove({selector});
$unset
db.help([commandName]);
batch insert
25. Clone the current database (implied by 'db') from another host.
Cursor
db.cloneDatabase(fromhost)
64-bit floating point numbers
document
26. Lists all the collections in the database in use.
show collections
$mod
Update Modifiers
$
27. Returns the size of a document after it is converted to BSON from the JSON-like original.
string
db.<col>.help([commandName]);
Object.bsonsize({document});
maximum value
28. Array specific conditional used to select based on the length or set-size of an array field value.
$size
$gt
db.commandHelp("commandName")
64-bit floating point numbers
29. Does not contain query conditional used to select documents with the field that is not in the selector list of values.
array
$nin
$all
binary data
30. Unique 12-byte ID for documents.
$unset
db.help([commandName]);
$rename
object id
31. Stored as milliseconds since the epoch.
date
$pushAll
$gt
db.<col>.remove({selector});
32. String of arbitrary bytes.
binary data
db.<collection>.insert({document});
minimum value
use <database name>
33. Meta query conditional used to negate the selector.
$not
db.<col>.help([commandName]);
use <database name>
db.<col>.update({selector},{document});
34. set of UTF-8 characters.
db.getLastError()
$elemMatch
Upsert
string
35. 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});
Update Modifiers
64-Bit Integer
36. command to start the mongodb process.
mongod
$pop
object id
$addToSet
37. ...
32-Bit Integer
$pushAll
batch insert
$lte
38. Clone the current database (implied by 'db') from another host.
db.cloneDatabase(fromhost)
boolean
db.<collection>.find([properties]);
key.index
39. Update a document in the collection.
null
$size
string
db.<col>.update({selector},{document});
40. changes the database on which you are working.
use <database name>
$lte
$size
db.<collection>.insert({document});
41. Returns help information for a command.
regular expression
array
db.<collection>.insert({document});
db.commandHelp("commandName")
42. Operator used in the second argument of the find() call to specify which slice of an array to return for an array field.
$slice
db.<col>.remove({selector});
db.<col>.remove({selector});
$rename
43. Not equal query conditional. ex: db.<col>.find({numVal: {$ne:3}});
regular expression
db.cloneDatabase(fromhost)
$ne
db.commandHelp("commandName")
44. command to start the mongo shell.
db.<collection>.insert({document});
mongo
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
string
45. Meta query conditional generating a modulus with the selector operand. Checks to see if the field value when divided by one value has the remainder of the second value.
$mod
$pull
db.<collection>.insert({document});
$all
46. The local variable representation of a query. Uniquely - the cursor does not hold the results but instead access to the results.
$gt
binary data
Cursor
$mod
47. Used to describe a variable as not having been initialized.
$rename
undefined
$in
$nin
48. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
$gte
64-bit floating point numbers
document
64-Bit Integer
49. Binary-encoded serialization of mongo documents.
db.commandHelp("commandName")
BSON
db.cloneDatabase(fromhost)
$pullAll
50. The standard number representation in the javascript shell.
$size
regular expression
64-bit floating point numbers
db.<col>.help([commandName]);