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