feat(NODE-6855): add WithTimestamp type for document timestamps#4462
feat(NODE-6855): add WithTimestamp type for document timestamps#4462baruchiro wants to merge 1 commit intomongodb:mainfrom
Conversation
Added a new WithTimestamp type that adds createdAt and updatedAt fields of type Date to any object shaped type. This follows the same pattern as the existing WithId type and allows for easy addition of timestamp fields to MongoDB document types.
|
Hey @baruchiro, thanks (again!) for reaching out. We are not sure if the driver is the best place for such a type as the driver is not responsible for adding these fields, users can use a multitude of types for their Given the breadth of possibilities we are not confident these would lend much value to anyone who isn't using this exact pattern, can you elaborate on where these fields come from for your use case and why having them in the driver is beneficial? For additional context, our similarly named |
|
@nbbeeken Now you're saying that, I see I was wrong. The' mongoose' system adds the "timestamp" fields if you set |
Description
Added a new WithTimestamp type that adds createdAt and updatedAt fields
of type Date to any object shaped type. This follows the same pattern as
the existing WithId type and allows for easy addition of timestamp fields
to MongoDB document types.
Is there new documentation needed for these changes?
What is the motivation for this change?
https://jira.mongodb.org/browse/NODE-6855
Release Highlight
Fill in title or leave empty for no highlight
Double check the following
npm run check:lintscripttype(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript