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