Skip to content

Commit

Permalink
docs(migrating_to_6): add note on #5124
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jul 30, 2021
1 parent ec1b601 commit 33bfeb6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions migrating_to_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

* Schema paths declared with `type: { name: String }` become single nested subdocs in Mongoose 6, as opposed to Mixed in Mongoose 5. This removes the need for the `typePojoToMixed` option. See [gh-7181](https://github.com/Automattic/mongoose/issues/7181).

* Mongoose now throws an error if you `populate()` a path that isn't defined in your schema. This is only for cases when we can infer the local schema, like when you use `Query#populate()`, **not** when you call `Model.populate()` on a POJO. See [gh-5124](https://github.com/Automattic/mongoose/issues/5124).

* When populating a subdocument with a function `ref` or `refPath`, `this` is now the subdocument being populated, not the top-level document. See [#8469](https://github.com/Automattic/mongoose/issues/8469)

* Single nested subdocs have been renamed to "subdocument paths". So `SchemaSingleNestedOptions` is now `SchemaSubdocumentOptions` and `mongoose.Schema.Types.Embedded` is now `mongoose.Schema.Types.Subdocument`. See [gh-10419](https://github.com/Automattic/mongoose/issues/10419)
Expand Down

0 comments on commit 33bfeb6

Please sign in to comment.