Skip to content

Commit

Permalink
Update docs/timestamps.md
Browse files Browse the repository at this point in the history
Co-authored-by: hasezoey <[email protected]>
  • Loading branch information
vkarpov15 and hasezoey authored Nov 4, 2024
1 parent 5dc355b commit 50daffd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/timestamps.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ If you need to disable Mongoose's timestamps and update a document's timestamps

```javascript
const createdAt = new Date('2011-06-01');
// Update a document's `createdAt` to a custom value. Normally Mongoose would prevent doing this because `createdAt`
// is immutable.
// Update a document's `createdAt` to a custom value.
// Normally Mongoose would prevent doing this because `createdAt` is immutable.
await Model.updateOne({ _id: doc._id }, { createdAt }, { overwriteImmutable: true, timestamps: false });

doc = await Model.collection.findOne({ _id: doc._id });
Expand Down

0 comments on commit 50daffd

Please sign in to comment.