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