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