Skip to content

Commit ad681e7

Browse files
feat: add support for disambiguatedPaths in change stream updates
1 parent be19511 commit ad681e7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/change_stream.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,25 @@ export interface UpdateDescription<TSchema extends Document = Document> {
496496
/** The number of elements in the truncated array. */
497497
newSize: number;
498498
}>;
499+
500+
/**
501+
* A document containing additional information about any ambiguous update paths from the update event. The document
502+
* maps the full ambiguous update path to an array containing the actual resolved components of the path. For example,
503+
* given a document shaped like `{ a: { '0': 0 } }`, and an update of `{ $inc: 'a.0' }`, disambiguated paths would look like
504+
* the following:
505+
*
506+
* ```
507+
* {
508+
* 'a.0': ['a', '0']
509+
* }
510+
* ```
511+
*
512+
* This field is only present when there are ambiguous paths are updated as a part of the update event and `showExpandedEvents`
513+
* is enabled for the change stream.
514+
* @since 6.1.0
515+
* @experimental
516+
*/
517+
disambiguatedPaths?: Document;
499518
}
500519

501520
/** @public */

0 commit comments

Comments
 (0)