Skip to content

Commit

Permalink
fix(NODE-4647): improve error message (#3409)
Browse files Browse the repository at this point in the history
Co-authored-by: Bailey Pearson <bailey.pearson@mongodb.com>
  • Loading branch information
LinusU and baileympearson committed Sep 28, 2022
1 parent 7c8ff33 commit 0d3c02e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 0d3c02e

Please sign in to comment.