@@ -205,6 +205,16 @@ export interface ChangeStreamDocumentCommon {
205
205
splitEvent ?: ChangeStreamSplitEvent ;
206
206
}
207
207
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
+
208
218
/** @public */
209
219
export interface ChangeStreamDocumentCollectionUUID {
210
220
/**
@@ -239,7 +249,8 @@ export interface ChangeStreamDocumentOperationDescription {
239
249
export interface ChangeStreamInsertDocument < TSchema extends Document = Document >
240
250
extends ChangeStreamDocumentCommon ,
241
251
ChangeStreamDocumentKey < TSchema > ,
242
- ChangeStreamDocumentCollectionUUID {
252
+ ChangeStreamDocumentCollectionUUID ,
253
+ ChangeStreamDocumentWallTime {
243
254
/** Describes the type of operation represented in this change notification */
244
255
operationType : 'insert' ;
245
256
/** This key will contain the document being inserted */
@@ -255,7 +266,8 @@ export interface ChangeStreamInsertDocument<TSchema extends Document = Document>
255
266
export interface ChangeStreamUpdateDocument < TSchema extends Document = Document >
256
267
extends ChangeStreamDocumentCommon ,
257
268
ChangeStreamDocumentKey < TSchema > ,
258
- ChangeStreamDocumentCollectionUUID {
269
+ ChangeStreamDocumentCollectionUUID ,
270
+ ChangeStreamDocumentWallTime {
259
271
/** Describes the type of operation represented in this change notification */
260
272
operationType : 'update' ;
261
273
/**
@@ -285,7 +297,8 @@ export interface ChangeStreamUpdateDocument<TSchema extends Document = Document>
285
297
*/
286
298
export interface ChangeStreamReplaceDocument < TSchema extends Document = Document >
287
299
extends ChangeStreamDocumentCommon ,
288
- ChangeStreamDocumentKey < TSchema > {
300
+ ChangeStreamDocumentKey < TSchema > ,
301
+ ChangeStreamDocumentWallTime {
289
302
/** Describes the type of operation represented in this change notification */
290
303
operationType : 'replace' ;
291
304
/** 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
309
322
export interface ChangeStreamDeleteDocument < TSchema extends Document = Document >
310
323
extends ChangeStreamDocumentCommon ,
311
324
ChangeStreamDocumentKey < TSchema > ,
312
- ChangeStreamDocumentCollectionUUID {
325
+ ChangeStreamDocumentCollectionUUID ,
326
+ ChangeStreamDocumentWallTime {
313
327
/** Describes the type of operation represented in this change notification */
314
328
operationType : 'delete' ;
315
329
/** Namespace the delete event occurred on */
@@ -330,7 +344,8 @@ export interface ChangeStreamDeleteDocument<TSchema extends Document = Document>
330
344
*/
331
345
export interface ChangeStreamDropDocument
332
346
extends ChangeStreamDocumentCommon ,
333
- ChangeStreamDocumentCollectionUUID {
347
+ ChangeStreamDocumentCollectionUUID ,
348
+ ChangeStreamDocumentWallTime {
334
349
/** Describes the type of operation represented in this change notification */
335
350
operationType : 'drop' ;
336
351
/** Namespace the drop event occurred on */
@@ -343,7 +358,8 @@ export interface ChangeStreamDropDocument
343
358
*/
344
359
export interface ChangeStreamRenameDocument
345
360
extends ChangeStreamDocumentCommon ,
346
- ChangeStreamDocumentCollectionUUID {
361
+ ChangeStreamDocumentCollectionUUID ,
362
+ ChangeStreamDocumentWallTime {
347
363
/** Describes the type of operation represented in this change notification */
348
364
operationType : 'rename' ;
349
365
/** The new name for the `ns.coll` collection */
@@ -356,7 +372,9 @@ export interface ChangeStreamRenameDocument
356
372
* @public
357
373
* @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event
358
374
*/
359
- export interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon {
375
+ export interface ChangeStreamDropDatabaseDocument
376
+ extends ChangeStreamDocumentCommon ,
377
+ ChangeStreamDocumentWallTime {
360
378
/** Describes the type of operation represented in this change notification */
361
379
operationType : 'dropDatabase' ;
362
380
/** The database dropped */
@@ -367,7 +385,9 @@ export interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCo
367
385
* @public
368
386
* @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event
369
387
*/
370
- export interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon {
388
+ export interface ChangeStreamInvalidateDocument
389
+ extends ChangeStreamDocumentCommon ,
390
+ ChangeStreamDocumentWallTime {
371
391
/** Describes the type of operation represented in this change notification */
372
392
operationType : 'invalidate' ;
373
393
}
@@ -380,7 +400,8 @@ export interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentComm
380
400
export interface ChangeStreamCreateIndexDocument
381
401
extends ChangeStreamDocumentCommon ,
382
402
ChangeStreamDocumentCollectionUUID ,
383
- ChangeStreamDocumentOperationDescription {
403
+ ChangeStreamDocumentOperationDescription ,
404
+ ChangeStreamDocumentWallTime {
384
405
/** Describes the type of operation represented in this change notification */
385
406
operationType : 'createIndexes' ;
386
407
}
@@ -393,7 +414,8 @@ export interface ChangeStreamCreateIndexDocument
393
414
export interface ChangeStreamDropIndexDocument
394
415
extends ChangeStreamDocumentCommon ,
395
416
ChangeStreamDocumentCollectionUUID ,
396
- ChangeStreamDocumentOperationDescription {
417
+ ChangeStreamDocumentOperationDescription ,
418
+ ChangeStreamDocumentWallTime {
397
419
/** Describes the type of operation represented in this change notification */
398
420
operationType : 'dropIndexes' ;
399
421
}
@@ -405,7 +427,8 @@ export interface ChangeStreamDropIndexDocument
405
427
*/
406
428
export interface ChangeStreamCollModDocument
407
429
extends ChangeStreamDocumentCommon ,
408
- ChangeStreamDocumentCollectionUUID {
430
+ ChangeStreamDocumentCollectionUUID ,
431
+ ChangeStreamDocumentWallTime {
409
432
/** Describes the type of operation represented in this change notification */
410
433
operationType : 'modify' ;
411
434
}
@@ -416,7 +439,8 @@ export interface ChangeStreamCollModDocument
416
439
*/
417
440
export interface ChangeStreamCreateDocument
418
441
extends ChangeStreamDocumentCommon ,
419
- ChangeStreamDocumentCollectionUUID {
442
+ ChangeStreamDocumentCollectionUUID ,
443
+ ChangeStreamDocumentWallTime {
420
444
/** Describes the type of operation represented in this change notification */
421
445
operationType : 'create' ;
422
446
@@ -435,7 +459,8 @@ export interface ChangeStreamCreateDocument
435
459
export interface ChangeStreamShardCollectionDocument
436
460
extends ChangeStreamDocumentCommon ,
437
461
ChangeStreamDocumentCollectionUUID ,
438
- ChangeStreamDocumentOperationDescription {
462
+ ChangeStreamDocumentOperationDescription ,
463
+ ChangeStreamDocumentWallTime {
439
464
/** Describes the type of operation represented in this change notification */
440
465
operationType : 'shardCollection' ;
441
466
}
0 commit comments