Skip to content

Commit

Permalink
style(typegoose): add link to mongoose issue for "Passthrough" class
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Jul 30, 2021
1 parent d022340 commit 3fd6f4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/api/decorators/prop.md
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ It is not recommended to use this class, it should always be another class if ne
The `Passthrough` class is, like the name implies, to pass-through an schema definition directly, without "wrapping" it in a `new Schema({}` call.

:::note
It should be noted that using this method (even in plain mongoose) will result in these paths to become `mongoose.Schema.Types.Mixed`, and also no typegoose transformations or warnings will be applied to what is inside `Passthrough` (like `type: () => Class` will not be translated, it will stay as-is)
It should be noted that using this method (even in plain mongoose) will result in these paths to become `mongoose.Schema.Types.Mixed` (see [Mongoose#7181](https://github.com/Automattic/mongoose/issues/7181)), and also no typegoose transformations or warnings will be applied to what is inside `Passthrough` (like `type: () => Class` will not be translated, it will stay as-is)
:::

The following example is what it looks like in typegoose, and what it would look like in plain mongoose:
Expand Down
2 changes: 1 addition & 1 deletion src/typegoose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export function getDiscriminatorModelForClass<U extends AnyParamConstructor<any>
/**
* Use this class if raw mongoose for this path is wanted
* It is still recommended to use the typegoose classes directly for full type and validation support
* Note: using this, paths are of type "Mixed" (with some validation)
* @see Using `Passthrough`, the paths created will result in `Mixed`, see {@link https://github.com/Automattic/mongoose/issues/7181 Mongoose#7181}
* @example
* ```ts
* class Dummy {
Expand Down

0 comments on commit 3fd6f4f

Please sign in to comment.