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