-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
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
bulkWrite throws an error when set timestamps: false
in schema
#10048
Labels
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
Comments
SoftwareSing
added a commit
to SoftwareSing/mongoose
that referenced
this issue
Mar 20, 2021
SoftwareSing
added a commit
to SoftwareSing/mongoose
that referenced
this issue
Mar 20, 2021
IslandRhythms
added
the
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
label
Mar 22, 2021
@SoftwareSing the below script executes without error. Please modify the below script to demonstrate your issue: const mongoose = require('mongoose');
mongoose.set('debug', true);
run().catch(err => console.log(err));
async function run() {
await mongoose.connect('mongodb://localhost:27017/test', {
useNewUrlParser: true,
useUnifiedTopology: true
});
await mongoose.connection.dropDatabase();
const schema = new mongoose.Schema({ name: String }, { timestamps: false });
const Model = mongoose.model('MyModel', schema)
await Model.bulkWrite([{
insertOne: {
document: { name: 'test' }
}
}]);
console.log('Done');
} |
vkarpov15
added
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
and removed
confirmed-bug
We've confirmed this is a bug in Mongoose and will fix it.
labels
Mar 30, 2021
@vkarpov15 well...... it's already fixed by #10050 , I don't know why this issue is reopened. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
can't reproduce
Mongoose devs have been unable to reproduce this issue. Close after 14 days of inactivity.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When set
timestamps: false
in schema,bulkWrite
withinsertOne
orreplaceOne
will throw an error.But it works fine when set
timestamps: null
or just don't set timestamps.If the current behavior is a bug, please provide the steps to reproduce.
error:
What is the expected behavior?
It should not throw any error.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
The text was updated successfully, but these errors were encountered: