@@ -205,6 +205,16 @@ export interface ChangeStreamDocumentCommon {
205205 splitEvent ?: ChangeStreamSplitEvent ;
206206}
207207
208+ /** @public */
209+ export interface ChangeStreamDocumentWallTime {
210+ /**
211+ * The server date and time of the database operation.
212+ * wallTime differs from clusterTime in that clusterTime is a timestamp taken from the oplog entry associated with the database operation event.
213+ * @sinceServerVersion 6.0.0
214+ */
215+ wallTime ?: Date ;
216+ }
217+
208218/** @public */
209219export interface ChangeStreamDocumentCollectionUUID {
210220 /**
@@ -239,7 +249,8 @@ export interface ChangeStreamDocumentOperationDescription {
239249export interface ChangeStreamInsertDocument < TSchema extends Document = Document >
240250 extends ChangeStreamDocumentCommon ,
241251 ChangeStreamDocumentKey < TSchema > ,
242- ChangeStreamDocumentCollectionUUID {
252+ ChangeStreamDocumentCollectionUUID ,
253+ ChangeStreamDocumentWallTime {
243254 /** Describes the type of operation represented in this change notification */
244255 operationType : 'insert' ;
245256 /** This key will contain the document being inserted */
@@ -255,7 +266,8 @@ export interface ChangeStreamInsertDocument<TSchema extends Document = Document>
255266export interface ChangeStreamUpdateDocument < TSchema extends Document = Document >
256267 extends ChangeStreamDocumentCommon ,
257268 ChangeStreamDocumentKey < TSchema > ,
258- ChangeStreamDocumentCollectionUUID {
269+ ChangeStreamDocumentCollectionUUID ,
270+ ChangeStreamDocumentWallTime {
259271 /** Describes the type of operation represented in this change notification */
260272 operationType : 'update' ;
261273 /**
@@ -285,7 +297,8 @@ export interface ChangeStreamUpdateDocument<TSchema extends Document = Document>
285297 */
286298export interface ChangeStreamReplaceDocument < TSchema extends Document = Document >
287299 extends ChangeStreamDocumentCommon ,
288- ChangeStreamDocumentKey < TSchema > {
300+ ChangeStreamDocumentKey < TSchema > ,
301+ ChangeStreamDocumentWallTime {
289302 /** Describes the type of operation represented in this change notification */
290303 operationType : 'replace' ;
291304 /** The fullDocument of a replace event represents the document after the insert of the replacement document */
@@ -309,7 +322,8 @@ export interface ChangeStreamReplaceDocument<TSchema extends Document = Document
309322export interface ChangeStreamDeleteDocument < TSchema extends Document = Document >
310323 extends ChangeStreamDocumentCommon ,
311324 ChangeStreamDocumentKey < TSchema > ,
312- ChangeStreamDocumentCollectionUUID {
325+ ChangeStreamDocumentCollectionUUID ,
326+ ChangeStreamDocumentWallTime {
313327 /** Describes the type of operation represented in this change notification */
314328 operationType : 'delete' ;
315329 /** Namespace the delete event occurred on */
@@ -330,7 +344,8 @@ export interface ChangeStreamDeleteDocument<TSchema extends Document = Document>
330344 */
331345export interface ChangeStreamDropDocument
332346 extends ChangeStreamDocumentCommon ,
333- ChangeStreamDocumentCollectionUUID {
347+ ChangeStreamDocumentCollectionUUID ,
348+ ChangeStreamDocumentWallTime {
334349 /** Describes the type of operation represented in this change notification */
335350 operationType : 'drop' ;
336351 /** Namespace the drop event occurred on */
@@ -343,7 +358,8 @@ export interface ChangeStreamDropDocument
343358 */
344359export interface ChangeStreamRenameDocument
345360 extends ChangeStreamDocumentCommon ,
346- ChangeStreamDocumentCollectionUUID {
361+ ChangeStreamDocumentCollectionUUID ,
362+ ChangeStreamDocumentWallTime {
347363 /** Describes the type of operation represented in this change notification */
348364 operationType : 'rename' ;
349365 /** The new name for the `ns.coll` collection */
@@ -356,7 +372,9 @@ export interface ChangeStreamRenameDocument
356372 * @public
357373 * @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event
358374 */
359- export interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon {
375+ export interface ChangeStreamDropDatabaseDocument
376+ extends ChangeStreamDocumentCommon ,
377+ ChangeStreamDocumentWallTime {
360378 /** Describes the type of operation represented in this change notification */
361379 operationType : 'dropDatabase' ;
362380 /** The database dropped */
@@ -367,7 +385,9 @@ export interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCo
367385 * @public
368386 * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event
369387 */
370- export interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon {
388+ export interface ChangeStreamInvalidateDocument
389+ extends ChangeStreamDocumentCommon ,
390+ ChangeStreamDocumentWallTime {
371391 /** Describes the type of operation represented in this change notification */
372392 operationType : 'invalidate' ;
373393}
@@ -380,7 +400,8 @@ export interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentComm
380400export interface ChangeStreamCreateIndexDocument
381401 extends ChangeStreamDocumentCommon ,
382402 ChangeStreamDocumentCollectionUUID ,
383- ChangeStreamDocumentOperationDescription {
403+ ChangeStreamDocumentOperationDescription ,
404+ ChangeStreamDocumentWallTime {
384405 /** Describes the type of operation represented in this change notification */
385406 operationType : 'createIndexes' ;
386407}
@@ -393,7 +414,8 @@ export interface ChangeStreamCreateIndexDocument
393414export interface ChangeStreamDropIndexDocument
394415 extends ChangeStreamDocumentCommon ,
395416 ChangeStreamDocumentCollectionUUID ,
396- ChangeStreamDocumentOperationDescription {
417+ ChangeStreamDocumentOperationDescription ,
418+ ChangeStreamDocumentWallTime {
397419 /** Describes the type of operation represented in this change notification */
398420 operationType : 'dropIndexes' ;
399421}
@@ -405,7 +427,8 @@ export interface ChangeStreamDropIndexDocument
405427 */
406428export interface ChangeStreamCollModDocument
407429 extends ChangeStreamDocumentCommon ,
408- ChangeStreamDocumentCollectionUUID {
430+ ChangeStreamDocumentCollectionUUID ,
431+ ChangeStreamDocumentWallTime {
409432 /** Describes the type of operation represented in this change notification */
410433 operationType : 'modify' ;
411434}
@@ -416,7 +439,8 @@ export interface ChangeStreamCollModDocument
416439 */
417440export interface ChangeStreamCreateDocument
418441 extends ChangeStreamDocumentCommon ,
419- ChangeStreamDocumentCollectionUUID {
442+ ChangeStreamDocumentCollectionUUID ,
443+ ChangeStreamDocumentWallTime {
420444 /** Describes the type of operation represented in this change notification */
421445 operationType : 'create' ;
422446
@@ -435,7 +459,8 @@ export interface ChangeStreamCreateDocument
435459export interface ChangeStreamShardCollectionDocument
436460 extends ChangeStreamDocumentCommon ,
437461 ChangeStreamDocumentCollectionUUID ,
438- ChangeStreamDocumentOperationDescription {
462+ ChangeStreamDocumentOperationDescription ,
463+ ChangeStreamDocumentWallTime {
439464 /** Describes the type of operation represented in this change notification */
440465 operationType : 'shardCollection' ;
441466}
0 commit comments