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