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