-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.
Milestone
Description
What is the current behavior?
When using instance of Number in filter mongo recieves an empty object instead of the number.
If the current behavior is a bug, please provide the steps to reproduce.
const mySchema = new Schema({
id: {
type: Number,
set: value => {
return new Number(value.valueOf());
}
}
});
const MyModel = mongoose.model('MyModel', mySchema);
MyModel.findOne({ id: 12345 });
command: find { find: "mymodel", filter: { id: {} }, projection: {}, limit: 1, singleBatch: true, batchSize: 1, returnKey: false, showRecordId: false, lsid: { id: UUID("blahblahblah") }, $db: "mydb" }
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
Node: 12
Mongo: 4.2
Mongoose: 5.7.0
Metadata
Metadata
Assignees
Labels
confirmed-bugWe've confirmed this is a bug in Mongoose and will fix it.We've confirmed this is a bug in Mongoose and will fix it.