Skip to content

docs(NODE-4072): update change stream example tests for the docs team #3173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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