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