diff --git a/src/cmap/connection.ts b/src/cmap/connection.ts index be819c7a6c..3cada6392c 100644 --- a/src/cmap/connection.ts +++ b/src/cmap/connection.ts @@ -633,8 +633,8 @@ export class Connection extends TypedEventEmitter { }); const buffer = Buffer.concat(await finalCommand.toBin()); - if (this.socket.write(buffer)) return; + if (this.socket.write(buffer)) return; return await once(this.socket, 'drain'); } diff --git a/src/write_concern.ts b/src/write_concern.ts index 8f2b288736..390646a3be 100644 --- a/src/write_concern.ts +++ b/src/write_concern.ts @@ -58,10 +58,10 @@ interface CommandWriteConcernOptions { * @see https://www.mongodb.com/docs/manual/reference/write-concern/ */ export class WriteConcern { - /** - * Request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. - * If w is 0 and is set on the command in the request, the server will not send a response. - */ + /** + * Request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * If w is 0 and is set on a write operation, the server will not send a response. + */ readonly w?: W; /** Request acknowledgment that the write operation has been written to the on-disk journal */ readonly journal?: boolean;