diff --git a/src/mongo_types.ts b/src/mongo_types.ts index fda9909429b..d27771e5cd8 100644 --- a/src/mongo_types.ts +++ b/src/mongo_types.ts @@ -45,6 +45,9 @@ export type InferIdType = TSchema extends { _id: infer IdType } /** Add an _id field to an object shaped type @public */ export type WithId = EnhancedOmit & { _id: InferIdType }; +/** Add timestamp fields (createdAt and updatedAt) to an object shaped type @public */ +export type WithTimestamp = TSchema & { createdAt: Date; updatedAt: Date }; + /** * Add an optional _id field to an object shaped type * @public