You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to rename deletedAt field to deleted_at. Is there a way to rename the field.
I tried using middleware like this.
Using Bookmark.deleteById or Bookmark.restore invokes updateMany relative to my mongo version, so i have to use updateMany middleware.
The code below doesn't return the current doc updated
BookmarkSchema.post('updateMany', (doc, next) => {
// This doesn't return the current document but rahter metadata of how many documents are updated
console.log({ doc });
next();
});
The text was updated successfully, but these errors were encountered:
I'm using mongoose timestamps in my schema and they're in the format like this:
I would like to rename
deletedAt
field todeleted_at
. Is there a way to rename the field.I tried using middleware like this.
Using
Bookmark.deleteById
orBookmark.restore
invokesupdateMany
relative to my mongo version, so i have to useupdateMany
middleware.The code below doesn't return the current doc updated
The text was updated successfully, but these errors were encountered: