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(NODE-4647): improve error message #3409

Merged
merged 2 commits into from Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/operations/delete.ts
Expand Up @@ -85,7 +85,8 @@ export class DeleteOperation extends CommandOperation<Document> {
const unacknowledgedWrite = this.writeConcern && this.writeConcern.w === 0;
if (unacknowledgedWrite) {
if (this.statements.find((o: Document) => o.hint)) {
callback(new MongoCompatibilityError(`Servers < 3.4 do not support hint on delete`));
// TODO(NODE-3541): fix error for hint with unacknowledged writes
callback(new MongoCompatibilityError(`hint is not supported with unacknowledged writes`));
return;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/operations/update.ts
Expand Up @@ -110,7 +110,8 @@ export class UpdateOperation extends CommandOperation<Document> {
const unacknowledgedWrite = this.writeConcern && this.writeConcern.w === 0;
if (unacknowledgedWrite) {
if (this.statements.find((o: Document) => o.hint)) {
callback(new MongoCompatibilityError(`Servers < 3.4 do not support hint on update`));
// TODO(NODE-3541): fix error for hint with unacknowledged writes
callback(new MongoCompatibilityError(`hint is not supported with unacknowledged writes`));
return;
}
}
Expand Down