@@ -258,6 +258,15 @@ export interface ChangeStreamInsertDocument<TSchema extends Document = Document>
258
258
fullDocument : TSchema ;
259
259
/** Namespace the insert event occured on */
260
260
ns : ChangeStreamNameSpace ;
261
+
262
+ /**
263
+ * The UUID of the collection that the operation was performed on.
264
+ *
265
+ * Only present when the `showExpandedEvents` flag is enabled.
266
+ *
267
+ * @since 6.1.0
268
+ */
269
+ collectionUUID : UUID ;
261
270
}
262
271
263
272
/**
@@ -288,6 +297,15 @@ export interface ChangeStreamUpdateDocument<TSchema extends Document = Document>
288
297
* pre-image is unavailable, this will be explicitly set to null.
289
298
*/
290
299
fullDocumentBeforeChange ?: TSchema ;
300
+
301
+ /**
302
+ * The UUID of the collection that the operation was performed on.
303
+ *
304
+ * Only present when the `showExpandedEvents` flag is enabled.
305
+ *
306
+ * @since 6.1.0
307
+ */
308
+ collectionUUID : UUID ;
291
309
}
292
310
293
311
/**
@@ -332,6 +350,15 @@ export interface ChangeStreamDeleteDocument<TSchema extends Document = Document>
332
350
* pre-image is unavailable, this will be explicitly set to null.
333
351
*/
334
352
fullDocumentBeforeChange ?: TSchema ;
353
+
354
+ /**
355
+ * The UUID of the collection that the operation was performed on.
356
+ *
357
+ * Only present when the `showExpandedEvents` flag is enabled.
358
+ *
359
+ * @since 6.1.0
360
+ */
361
+ collectionUUID : UUID ;
335
362
}
336
363
337
364
/**
@@ -343,6 +370,15 @@ export interface ChangeStreamDropDocument extends ChangeStreamDocumentCommon {
343
370
operationType : 'drop' ;
344
371
/** Namespace the drop event occured on */
345
372
ns : ChangeStreamNameSpace ;
373
+
374
+ /**
375
+ * The UUID of the collection that the operation was performed on.
376
+ *
377
+ * Only present when the `showExpandedEvents` flag is enabled.
378
+ *
379
+ * @since 6.1.0
380
+ */
381
+ collectionUUID : UUID ;
346
382
}
347
383
348
384
/**
@@ -357,24 +393,13 @@ export interface ChangeStreamRenameDocument extends ChangeStreamDocumentCommon {
357
393
/** The "from" namespace that the rename occured on */
358
394
ns : ChangeStreamNameSpace ;
359
395
/**
360
- * An operation description representing the changes in a `rename` event .
396
+ * An description of the operation .
361
397
*
362
398
* Only present when the `showExpandedEvents` flag is enabled.
363
399
*
364
- * @since 6.0 .0
400
+ * @since 6.1 .0
365
401
*/
366
- operationDescription ?: {
367
- /**
368
- * Contains two fields: "db" and "coll" containing the database and
369
- * collection name in which the change happened.
370
- */
371
- to ?: { db : string ; coll : string } ;
372
-
373
- /**
374
- * The uuid of the target collection that was dropped.
375
- */
376
- dropTarget ?: UUID ; // TODO - confirm that this value is optional
377
- } ;
402
+ operationDescription ?: Document ;
378
403
}
379
404
380
405
/**
@@ -405,6 +430,24 @@ export interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentComm
405
430
export interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCommon {
406
431
/** Describes the type of operation represented in this change notification */
407
432
operationType : 'createIndexes' ;
433
+
434
+ /**
435
+ * The UUID of the collection that the operation was performed on.
436
+ *
437
+ * Only present when the `showExpandedEvents` flag is enabled.
438
+ *
439
+ * @since 6.1.0
440
+ */
441
+ collectionUUID : UUID ;
442
+
443
+ /**
444
+ * An description of the operation.
445
+ *
446
+ * Only present when the `showExpandedEvents` flag is enabled.
447
+ *
448
+ * @since 6.1.0
449
+ */
450
+ operationDescription ?: Document ;
408
451
}
409
452
410
453
/**
@@ -415,6 +458,24 @@ export interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCom
415
458
export interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommon {
416
459
/** Describes the type of operation represented in this change notification */
417
460
operationType : 'dropIndexes' ;
461
+
462
+ /**
463
+ * The UUID of the collection that the operation was performed on.
464
+ *
465
+ * Only present when the `showExpandedEvents` flag is enabled.
466
+ *
467
+ * @since 6.1.0
468
+ */
469
+ collectionUUID : UUID ;
470
+
471
+ /**
472
+ * An description of the operation.
473
+ *
474
+ * Only present when the `showExpandedEvents` flag is enabled.
475
+ *
476
+ * @since 6.1.0
477
+ */
478
+ operationDescription ?: Document ;
418
479
}
419
480
420
481
/**
@@ -425,6 +486,15 @@ export interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommo
425
486
export interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon {
426
487
/** Describes the type of operation represented in this change notification */
427
488
operationType : 'modify' ;
489
+
490
+ /**
491
+ * The UUID of the collection that the operation was performed on.
492
+ *
493
+ * Only present when the `showExpandedEvents` flag is enabled.
494
+ *
495
+ * @since 6.1.0
496
+ */
497
+ collectionUUID : UUID ;
428
498
}
429
499
430
500
/**
@@ -434,6 +504,96 @@ export interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon
434
504
export interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon {
435
505
/** Describes the type of operation represented in this change notification */
436
506
operationType : 'create' ;
507
+
508
+ /**
509
+ * The UUID of the collection that the operation was performed on.
510
+ *
511
+ * Only present when the `showExpandedEvents` flag is enabled.
512
+ *
513
+ * @since 6.1.0
514
+ */
515
+ collectionUUID : UUID ;
516
+ }
517
+
518
+ /**
519
+ * @public
520
+ * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event
521
+ */
522
+ export interface ChangeStreamShardCollectionDocument extends ChangeStreamDocumentCommon {
523
+ /** Describes the type of operation represented in this change notification */
524
+ operationType : 'shardCollection' ;
525
+
526
+ /**
527
+ * The UUID of the collection that the operation was performed on.
528
+ *
529
+ * Only present when the `showExpandedEvents` flag is enabled.
530
+ *
531
+ * @since 6.1.0
532
+ */
533
+ collectionUUID : UUID ;
534
+
535
+ /**
536
+ * An description of the operation.
537
+ *
538
+ * Only present when the `showExpandedEvents` flag is enabled.
539
+ *
540
+ * @since 6.1.0
541
+ */
542
+ operationDescription ?: Document ;
543
+ }
544
+
545
+ /**
546
+ * @public
547
+ * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event
548
+ */
549
+ export interface ChangeStreamReshardCollectionDocument extends ChangeStreamDocumentCommon {
550
+ /** Describes the type of operation represented in this change notification */
551
+ operationType : 'reshardCollection' ;
552
+
553
+ /**
554
+ * The UUID of the collection that the operation was performed on.
555
+ *
556
+ * Only present when the `showExpandedEvents` flag is enabled.
557
+ *
558
+ * @since 6.1.0
559
+ */
560
+ collectionUUID : UUID ;
561
+
562
+ /**
563
+ * An description of the operation.
564
+ *
565
+ * Only present when the `showExpandedEvents` flag is enabled.
566
+ *
567
+ * @since 6.1.0
568
+ */
569
+ operationDescription ?: Document ;
570
+ }
571
+
572
+ /**
573
+ * @public
574
+ * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event
575
+ */
576
+ export interface ChangeStreamRefineCollectionShardKeyDocument extends ChangeStreamDocumentCommon {
577
+ /** Describes the type of operation represented in this change notification */
578
+ operationType : 'refineCollectionShardKey' ;
579
+
580
+ /**
581
+ * The UUID of the collection that the operation was performed on.
582
+ *
583
+ * Only present when the `showExpandedEvents` flag is enabled.
584
+ *
585
+ * @since 6.1.0
586
+ */
587
+ collectionUUID ?: UUID ;
588
+
589
+ /**
590
+ * An description of the operation.
591
+ *
592
+ * Only present when the `showExpandedEvents` flag is enabled.
593
+ *
594
+ * @since 6.1.0
595
+ */
596
+ operationDescription ?: Document ;
437
597
}
438
598
439
599
/** @public */
@@ -449,7 +609,10 @@ export type ChangeStreamDocument<TSchema extends Document = Document> =
449
609
| ChangeStreamCreateIndexDocument
450
610
| ChangeStreamCreateDocument
451
611
| ChangeStreamCollModDocument
452
- | ChangeStreamDropIndexDocument ;
612
+ | ChangeStreamDropIndexDocument
613
+ | ChangeStreamShardCollectionDocument
614
+ | ChangeStreamReshardCollectionDocument
615
+ | ChangeStreamRefineCollectionShardKeyDocument ;
453
616
454
617
/** @public */
455
618
export interface UpdateDescription < TSchema extends Document = Document > {
0 commit comments