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