Skip to content

error in documentation of mongoose. #368

Discussion options

You must be logged in to vote

@ashupn10, thank you for starting this thread. For future reference, it's best to report issues like this one as an issue on the content repository here. The documentation here is, in fact, correct.

When you look at this part of the code:

const BookSchema = new Schema({
  title: { type: String, required: true },
  author: { type: Schema.Types.ObjectId, ref: "Author", required: true },
  summary: { type: String, required: true },
  isbn: { type: String, required: true },
  genre: [{ type: Schema.Types.ObjectId, ref: "Genre" }],
});

The explanation you refer to talks about the following two lines of code:

author: { type: Schema.Types.ObjectId, ref: "Author", required: true },
genre: [{ typ…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by bsmth
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants