We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36e0c4e commit 4d93a5cCopy full SHA for 4d93a5c
docs/typescript/virtuals.md
@@ -28,6 +28,9 @@ const schema = new Schema(
28
);
29
```
30
31
+If you are using automatic schema inference, you should define virtuals using the `virtuals` option in the schema constructor as shown above.
32
+Mongoose will not automatically infer any virtuals you define using `Schema.prototype.virtual()`.
33
+
34
Note that Mongoose does **not** include virtuals in the returned type from `InferSchemaType`.
35
That is because `InferSchemaType` returns a value similar to the raw document interface, which represents the structure of the data stored in MongoDB.
36
0 commit comments