#### [[notes_MongoDB and Mongoose ]]
**Creator**::
**Source**::
**Covers**:: [[Computer Science]], [[Software Development]]
Q:: What is Atlas?
A::
A cloud based service for MongoDB
Q:: The following code will create a User model from a userSchema
A::
`const User = ccompile(userSchema, mongoose)`
Q:: In mongoose, we can use SQL to restrict search results on Number properties.
A::
false
Q:: In a mongoose schema, we need to have a property for the autogenerated id
A::
false
Q:: In a mongoose Schema, a property can have a type of Date
A::
true
Q:: In mongoose, we can use regular expressions to restrict the results of a query
A::
true
Q:: Given that user1 is an instance of a User, how can we store the instance in the MongoDB?
A::
User.save(user1, callback)
Q:: Which of the following kinds of data bases can be used by Express?
A::
Both SQL and Mongo
Q:: In mongoose, we can add a validator function to a model property which returns "valid" or "not valid"
A::
false
Q:: Which of the following is NOT something that a Mongoose Schema provides?
A::
business logic hooks
Q:: In a mongoose Schema, a property can have a type of Double
A::
false
Q:: Given that user1 is an instance of a User, how can we store the instance in the MongoDB?
A::
`user1.save with a callback`
Q:: If user1 is an instance of the User model, we can delete it from the MongoDB by doing
A::
`user1.delete()`