1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
collections.insert_one({“key” : “value”})
Syntax to create a document inside a collection.
True
True or False. If we did not assign an object ID to a document, MongoDB will automatically create one.
True
True or False. An object ID must be unique and not an array.
False
True or False. MongoDB will continue processing inserts even upon encountering an error.
True
True or False. The value of a field can be an array.
collections.find({“key” : “value”})
Syntax for accessing a document according to a specific key.
Dot notation
To access a value of a nested key-value pair, you use this notation.
collections.delete_one({“key” : “value”})
Syntax for deleting the first instance of the specified condition.
collections.delete_many({“key” : “value”})
Syntax for deleting all the instances of the specified condition.
collections.drop()
Syntax for deleting the collection.
client.drop_database(“database_name”)
Syntax to delete a database.
Projection parameter
Specifies the keys that you want to show in the filter field results.
Cursor
When using find(), MongoDB will return an object that points to a result. What is this object that you assign to a variable?
.sort(“basis_of_the_sort”, 1 or 0)
Syntax for sorting a result.
.skip(a)
Syntax for skipping/not displaying a certain number of records, a.
.limit(a)
Syntax for returning only a certain number of records displayed in the results field, a.