We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.6.3
doesn't matter
5.6.2
InferSchemaType returns Buffer instead of Binary(from BSON) for Buffer field
const exampleSchema = new Schema({ image: { type: Buffer }, }); export type Example = InferSchemaType<typeof exampleSchema>; // type Example = { // image?: Buffer | null | undefined; // }
type Example is:
type Example = { image?: Binary | null | undefined; }
(Binary from BSON)
The text was updated successfully, but these errors were encountered:
That's correct in the sense that image will typically be a Buffer when you access that property. What is your use case for image being a Binary?
image
Buffer
Sorry, something went wrong.
Oh sorry i forgot about this issue, it turned out Buffer field will be Binary for leaned document.
8825b76
Merge pull request #14967 from Automattic/vkarpov15/gh-14902
de211db
types: make Buffers into mongodb.Binary in lean result type to match runtime behavior
Successfully merging a pull request may close this issue.
Prerequisites
Mongoose version
8.6.3
Node.js version
doesn't matter
MongoDB server version
doesn't matter
Typescript version (if applicable)
5.6.2
Description
InferSchemaType returns Buffer instead of Binary(from BSON) for Buffer field
Steps to Reproduce
Expected Behavior
type Example is:
(Binary from BSON)
The text was updated successfully, but these errors were encountered: