Skip to content

Commit

Permalink
docs(NODE-4072): update change stream example tests for the docs team (
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson authored Mar 15, 2022
1 parent ff26b12 commit d43bd10
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ maybeDescribe('examples(change-stream):', function () {

// Start Changestream Example 2
const collection = db.collection('inventory');
const changeStream = collection.watch({ fullDocument: 'updateLookup' });
const changeStream = collection.watch([], { fullDocument: 'updateLookup' });
changeStream.on('change', next => {
// process next document
});
// End Changestream Example 2

// Start Changestream Example 2 Alternative
const changeStreamIterator = collection.watch({ fullDocument: 'updateLookup' });
const changeStreamIterator = collection.watch([], { fullDocument: 'updateLookup' });
const next = await changeStreamIterator.next();
// End Changestream Example 2 Alternative

Expand Down Expand Up @@ -137,7 +137,7 @@ maybeDescribe('examples(change-stream):', function () {
const resumeToken = changeStream.resumeToken;
changeStream.close();

newChangeStream = collection.watch({ resumeAfter: resumeToken });
newChangeStream = collection.watch([], { resumeAfter: resumeToken });
newChangeStream.on('change', next => {
processChange(next);
});
Expand All @@ -151,7 +151,7 @@ maybeDescribe('examples(change-stream):', function () {
const resumeToken = changeStreamIterator.resumeToken;
changeStreamIterator.close();

const newChangeStreamIterator = collection.watch({ resumeAfter: resumeToken });
const newChangeStreamIterator = collection.watch([], { resumeAfter: resumeToken });
const change2 = await newChangeStreamIterator.next();
// End Changestream Example 3 Alternative

Expand Down

0 comments on commit d43bd10

Please sign in to comment.