Pranav Rao
Pranav Rao
> I wrote a simple API for learning using express, when I try to send a POST request from POSTMAN it is carried out and returns a success message but...
https://stackoverflow.com/questions/75586474/mongoose-stopped-accepting-callbacks-for-some-of-its-functions Apparently countDocuments() doesn't accept call backs anymore so you should use await/async instead.
The way I added my timestamps is as follows: const MySchema = new Schema({ username: String, date_joined: Date, }, { timestamps: true });
https://mongoosejs.com/docs/api/model.html#Model.updateOne() Just add option {timestamps: false} after {$set: {}} update query like ` const res = await Event.updateOne({ url: "google.com" }, { $set: {} }, {timestamps: false}); //outputs {acknowledged: false}`
If you read the docs, this keeps the timestamps for the schema, but skips the timestamp for the update query.
What I tried doing was making a pre schema for updateOne and checking if city and url were null, undefined or empty string , or check that they equal the...
@vkarpov15 I'd like to help with adding this feature to mongoose 9.
I cannot access originalUnparsedPath. I have express 4.18.2
I'd like to work on this issue