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