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