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. Removes all occurrences of a value from a field. ex: { $pull : { field : _value } }
$pull
$pushAll
db.getLastError()
$size
2. Less than query conditional. ex: db.<col>.find({numVal: {$lt:3}});
db.<collection>.findOne([properties]);
key.index
$lt
document
3. Returns the size of a document after it is converted to BSON from the JSON-like original.
boolean
db.commandHelp("commandName")
$mod
Object.bsonsize({document});
4. Meta query conditional used to negate the selector.
$not
BSON
maximum value
db.commandHelp("commandName")
5. Data structure used to store all other data in mongo databases.
document
Update Modifiers
db.<col>.remove({selector});
64-bit floating point numbers
6. Greater than query conditional. ex: db.<col>.find({numVal: {$gt:3}});
$gt
$set
$pushAll
binary data
7. 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
date
embedded document
$pull
8. Updates all matching documents, not just the first, that match the selector.
Cursor
batch insert
db.help([commandName]);
Multi-updates
9. Set or list of values.
$set
mongod
undefined
array
10. Syntax used for selectors to be specific to a certain element position within an array.
db.<collection>.find([properties]);
binary data
key.index
$not
11. Returns help information for a command.
$pullAll
db.commandHelp("commandName")
undefined
$inc
12. command to start the mongo shell.
mongo
document
$pushAll
$addToSet
13. Update modifier used to increment a value. ex: {"$inc":{"counter":2}}
db.<col>.remove({selector});
maximum value
undefined
$inc
14. 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.
document
help
db.myCollection.ensureIndex({keypattern},[{options}])
Upsert
15. Standard javascript regular expressions. These can be stored in documents
minimum value
regular expression
$lt
$unset
16. Javascript code. Documents can contain code as values.
code
embedded document
$pushAll
$unset
17. Operator allowing the partial specification of fields in an embedded document in an array.
BSON
boolean
$elemMatch
$ne
18. Command to list commands and descriptions of those commands in the context of the database.
db.cloneDatabase(fromhost)
help
$slice
$ne
19. 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 } }
mongo
embedded document
date
$pop
20. Returns help information for a command.
$pullAll
db.commandHelp("commandName")
db.<collection>.find([properties]);
$
21. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
mongod
db.getLastError()
$nin
32-Bit Integer
22. Removes all occurrences of each value in the passed in array from the field. ex: { $pullAll : { field : value_array } }
db.<col>.help([commandName]);
db.myCollection.ensureIndex({keypattern},[{options}])
$inc
$pullAll
23. command to start the mongo shell.
$where
db.commandHelp("commandName")
db.commandHelp("commandName")
mongo
24. 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.
db.<col>.remove({selector});
$pushAll
db.runCommand({fsync:1,lock:1,async:1})
32-Bit Integer
25. 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.help([commandName]);
maximum value
$pullAll
$all
26. changes the database on which you are working.
$lt
$in
$not
use <database name>
27. Not equal query conditional. ex: db.<col>.find({numVal: {$ne:3}});
db.cloneDatabase(fromhost)
db.<collection>.insert({document});
$ne
$in
28. The local variable representation of a query. Uniquely - the cursor does not hold the results but instead access to the results.
$ne
Cursor
$size
db.commandHelp("commandName")
29. command to start the mongodb process.
string
db.cloneDatabase(fromhost)
use <database name>
mongod
30. Array specific conditional used to select based on the length or set-size of an array field value.
minimum value
$size
db.<col>.help([commandName]);
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
31. Operator allowing the execution of arbitrary javascript as part of the selector.
mongo
key.index
Upsert
$where
32. Renames a field from the one indicated to the new field name. ex: { $rename : { old_field_name : new_field_name } }
batch insert
db.<collection>.findOne([properties]);
$pullAll
$rename
33. Query conditional allowing the selector to choose between more than one optional criteria.
$pull
$or
$nin
$pushAll
34. Returns all the documents matching the optional properties.
db.<collection>.find([properties]);
$set
$elemMatch
$slice
35. Returns information about the last operation. Not necessarily error data - the return can contain things like number of records updated.
$pullAll
db.<col>.help([commandName]);
db.commandHelp("commandName")
db.getLastError()
36. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
64-Bit Integer
maximum value
db.help([commandName]);
db.cloneDatabase(fromhost)
37. String of arbitrary bytes.
binary data
$size
$pullAll
$unset
38. Greater than or equal query conditional. ex: db.<col>.find({numVal: {$gte:3}});
$gte
db.<collection>.insert({document});
$pullAll
db.<collection>.findOne([properties]);
39. Returns all the documents matching the optional properties.
$gte
db.<collection>.find([properties]);
$ne
$elemMatch
40. Unique 12-byte ID for documents.
mongo
$
db.cloneDatabase(fromhost)
object id
41. ...
batch insert
$elemMatch
$nin
64-Bit Integer
42. A document contained by a parent document. The embedded document is a value of a key in the parent document.
key.index
embedded document
$mod
$gt
43. Adds a document to a collection.
batch insert
$inc
$gte
db.<collection>.insert({document});
44. 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>
$set
$gte
$push
45. Less than or equal query conditional. ex: db.<col>.find({numVal: {$lte:3}});
$or
$addToSet
BSON
$lte
46. In BSON - represents the largest possible value.
$mod
maximum value
regular expression
$addToSet
47. Used to describe a variable as not having been initialized.
undefined
document
db.getLastError()
code
48. 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 },
$set
$all
binary data
$
49. Deletes documents from the collection based on the selector.
db.<col>.remove({selector});
db.<collection>.findOne([properties]);
use <database name>
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
50. 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.
Update Modifiers
db.<collection>.find([properties]);
db.<collection>.findOne([properties]);
$size