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.
$where
db.commandHelp("commandName")
$in
minimum value
2. Javascript code. Documents can contain code as values.
code
mongo
db.<collection>.find([properties]);
date
3. Adds a document to a collection.
mongod
$
$lte
db.<collection>.insert({document});
4. Deletes documents from the collection based on the selector.
$nin
db.<col>.remove({selector});
$lt
Object.bsonsize({document});
5. 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});
$
db.commandHelp("commandName")
$lt
6. 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.
$pull
db.<col>.help([commandName]);
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
null
7. 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.<collection>.findOne([properties]);
$ne
$
$all
8. command to start the mongodb process.
$elemMatch
mongod
db.<col>.update({selector},{document});
db.cloneDatabase(fromhost)
9. Adds a document to a collection.
regular expression
db.getLastError()
db.<collection>.insert({document});
32-Bit Integer
10. command to start the mongo shell.
Upsert
binary data
mongo
db.<collection>.find([properties]);
11. 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.
$pull
$rename
db.runCommand({fsync:1,lock:1,async:1})
$pullAll
12. command to start the mongo shell.
mongo
$in
$gte
minimum value
13. Removes all occurrences of a value from a field. ex: { $pull : { field : _value } }
batch insert
$gt
db.help([commandName]);
$pull
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.
Upsert
object id
db.<collection>.find([properties]);
$mod
15. Returns one document matching the optional properties.
key.index
db.<collection>.findOne([properties]);
minimum value
$not
16. 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.commandHelp("commandName")
$push
$all
$size
17. Standard javascript regular expressions. These can be stored in documents
binary data
boolean
regular expression
32-Bit Integer
18. Operator allowing the partial specification of fields in an embedded document in an array.
$elemMatch
$mod
show collections
db.<col>.remove({selector});
19. 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
$lte
$where
64-Bit Integer
20. Standard binary data type.
$slice
embedded document
boolean
Cursor
21. set of UTF-8 characters.
string
mongod
undefined
$ne
22. Syntax used for selectors to be specific to a certain element position within an array.
32-Bit Integer
db.<collection>.findOne([properties]);
key.index
BSON
23. command to start the mongodb process.
binary data
$pullAll
mongod
maximum value
24. Greater than query conditional. ex: db.<col>.find({numVal: {$gt:3}});
use <database name>
$gt
$all
$pullAll
25. Stored as milliseconds since the epoch.
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
date
mongo
$ne
26. In BSON - represents the smallest possible value.
$pop
maximum value
minimum value
db.runCommand({fsync:1,lock:1,async:1})
27. The local variable representation of a query. Uniquely - the cursor does not hold the results but instead access to the results.
Cursor
db.<collection>.findOne([properties]);
mongod
db.commandHelp("commandName")
28. Not supported by the javascript shell and are converted to 64-bit floating point numbers.
db.<col>.remove({selector});
32-Bit Integer
$lte
document
29. changes the database on which you are working.
db.myCollection.ensureIndex({keypattern},[{options}])
$pop
use <database name>
32-Bit Integer
30. changes the database on which you are working.
$lte
$mod
$pushAll
use <database name>
31. Update a document in the collection.
$size
db.<col>.update({selector},{document});
$
64-Bit Integer
32. Used to describe a variable as not having been initialized.
undefined
$pop
$
db.cloneDatabase(fromhost)
33. Command to get help docs on a specific command at the db level.
maximum value
$pull
db.help([commandName]);
db.commandHelp("commandName")
34. Greater than or equal query conditional. ex: db.<col>.find({numVal: {$gte:3}});
db.<collection>.insert({document});
db.cloneDatabase(fromhost)
$gte
$
35. Creates an index on property(s). Options can describe the type of sorting, uniqueness, etc.
$size
$all
$push
db.myCollection.ensureIndex({keypattern},[{options}])
36. Binary-encoded serialization of mongo documents.
db.commandHelp("commandName")
db.help([commandName]);
db.copyDatabase(frmDBName, toDBName, [frmHostName], [user], [pwd]);
BSON
37. Command to get help docs on a specific command at the collection level.
Update Modifiers
db.<col>.help([commandName]);
$size
64-Bit Integer
38. Returns help information for a command.
db.<col>.remove({selector});
$not
Object.bsonsize({document});
db.commandHelp("commandName")
39. Returns all the documents matching the optional properties.
db.<collection>.find([properties]);
boolean
null
use <database name>
40. Update modifier used to increment a value. ex: {"$inc":{"counter":2}}
Multi-updates
use <database name>
$inc
undefined
41. Unique 12-byte ID for documents.
$inc
object id
Object.bsonsize({document});
show collections
42. 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.
$lte
$mod
string
$in
43. Clone the current database (implied by 'db') from another host.
db.<col>.help([commandName]);
db.cloneDatabase(fromhost)
Object.bsonsize({document});
$mod
44. Updates all matching documents, not just the first, that match the selector.
undefined
string
db.<collection>.insert({document});
Multi-updates
45. Clone the current database (implied by 'db') from another host.
object id
document
$ne
db.cloneDatabase(fromhost)
46. ...
batch insert
document
$lt
db.getLastError()
47. 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"}});
regular expression
$addToSet
$set
Object.bsonsize({document});
48. 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 } }
$unset
$push
maximum value
$pop
49. Renames a field from the one indicated to the new field name. ex: { $rename : { old_field_name : new_field_name } }
$rename
db.getLastError()
$gt
use <database name>
50. Operator allowing the execution of arbitrary javascript as part of the selector.
$lt
$where
$gt
$pullAll