Skip to content
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

refactor!: CreateIndexOp returns string, CreateIndexesOp returns array #2666

Merged
merged 4 commits into from Dec 14, 2020

Conversation

emadum
Copy link
Contributor

@emadum emadum commented Dec 7, 2020

CreateIndexesOperation was returning the name of the created index
instead of the result from the server because of the logic ensuring
CreateIndexOperation has that behavior.

This PR makes CreateIndexesOperation return an array of index names
(breaking change), while CreateIndexOperation continues to return a
single index name string. This makes the behavior consistent with other
official drivers.

Users in need of the raw result from the server should use db.command.

NODE-2602

@emadum emadum marked this pull request as ready for review December 7, 2020 20:41
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

LGTM

src/operations/indexes.ts Outdated Show resolved Hide resolved
src/operations/indexes.ts Outdated Show resolved Hide resolved
@emadum emadum requested a review from mbroadst December 8, 2020 22:11
src/operations/indexes.ts Outdated Show resolved Hide resolved
@emadum emadum requested a review from mbroadst December 11, 2020 12:50
Copy link
Member

@mbroadst mbroadst left a comment

Choose a reason for hiding this comment

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

LGTM

@emadum emadum merged commit e12c485 into master Dec 14, 2020
@emadum emadum deleted the NODE-2602/create-indexes-return-index-names branch December 14, 2020 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants