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