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