Skip to content

fix(db_ops): call collection.find() with correct parameters - #1795

Merged
kvwalker merged 4 commits into
mongodb:masterfrom
kvwalker:NODE-1596
Aug 8, 2018
Merged

fix(db_ops): call collection.find() with correct parameters#1795
kvwalker merged 4 commits into
mongodb:masterfrom
kvwalker:NODE-1596

Conversation

@kvwalker

Copy link
Copy Markdown
Contributor

Fixes NODE-1596

@shsaskin shsaskin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread lib/operations/db_ops.js Outdated
}
);
});
finalOptions.projection = { dbName: 1 };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finalOptions is subsequently used for the below updateOne call, so you have inadvertently added a projection to that command.

Comment thread lib/operations/db_ops.js Outdated
}
);
});
let findOptions = finalOptions;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be const, since we are not changing the reference.

@daprahamian daprahamian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kvwalker
kvwalker merged commit 36e92f1 into mongodb:master Aug 8, 2018
@kvwalker
kvwalker deleted the NODE-1596 branch August 8, 2018 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants