Skip to content

Commit

Permalink
fix(NODE-4647): improve error message (mongodb#3409)
Browse files Browse the repository at this point in the history
Co-authored-by: Bailey Pearson <bailey.pearson@mongodb.com>
  • Loading branch information
2 people authored and ZLY201 committed Nov 5, 2022
1 parent 69b0dd8 commit f3ced82
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 f3ced82

Please sign in to comment.