-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request
Milestone
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Mongoose version
8.10.0
Node.js version
22.8.0
MongoDB server version
6.12.0
Typescript version (if applicable)
5.4.5
Description
When omiting the versionKey from a schema the __v property is still present in typescript.
Steps to Reproduce
Create a schema and notice the __v property still present after omitting versionKey
const documentSchema = new Schema({}, {strict: false, versionKey: false})
export const DB = mongoose.model("cart", documentSchema, "cart");
const b = await DB.findOne().lean()
b?.__v
Expected Behavior
Expect __v to be removed from typescript types.
Metadata
Metadata
Assignees
Labels
typescriptTypes or Types-test related issue / Pull RequestTypes or Types-test related issue / Pull Request