Conversation
|
|
||
| * **Your Answer:** | ||
|
|
||
| It is adding the primary key, the unique value. |
There was a problem hiding this comment.
This is not quite right. If you include the above in your code, it will require you to send an ObjectID when creating a new record.
| * **Your Answer:** | ||
|
|
||
| --- | ||
| module.exports = mongoose.model('Series', schema) will return all documents. |
There was a problem hiding this comment.
In this case, I'm referring the .find() method.
|
|
||
| * **Your Answer:** | ||
|
|
||
| It will fail on the schema validation. |
There was a problem hiding this comment.
It actually won't, unless you set up validations as part of it! You can submit partial data with Mongo.
|
|
||
| * **Your Answer:** | ||
|
|
||
| async await method. |
There was a problem hiding this comment.
The question here is about what Mongoose method to use. For example, you can use .find() or .findById().
| * **Question:** What are the arguments for `Model.updateOne()`? | ||
|
|
||
| * **Your Answer:** | ||
| updateOne will update the first one it finds vs. findOneAndUpdate requires the ID. |
There was a problem hiding this comment.
The arguments here are filter, doc, and then options.
|
|
||
| * **Your Answer:** | ||
|
|
||
| I am not sure on this question. |
There was a problem hiding this comment.
You should encounter an error when you run .create().select(). You will have to re-request the information or use the .save() method to return the updated record.
No description provided.