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