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

fix(shell-api): mongosh should throw an error when trying to drop a non-primary index MONGOSH-1608 #2221

Merged
merged 7 commits into from
Oct 18, 2024

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Oct 15, 2024

test> response = db.test.dropIndex({"a": 1});
MongoshInternalError: can't find index with key: { a: 1 }

test> console.info(response);
{
  ok: 0,
  errmsg: "can't find index with key: { a: 1 }",
  code: 27,
  codeName: 'IndexNotFound'
}

mongosh seems to throw the error here instead of the dropIndex request going to the server. Hence response variable doesn't end up being set.

@gagik gagik merged commit 15faeba into main Oct 18, 2024
66 of 69 checks passed
@gagik gagik deleted the gagik/dropindex-throw-error branch October 18, 2024 09:46
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.

2 participants