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