forked from openiap/opencore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateManyMessage.ts
More file actions
26 lines (24 loc) · 1.06 KB
/
Copy pathUpdateManyMessage.ts
File metadata and controls
26 lines (24 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { Base } from "../base";
import { UpdateWriteOpResult } from "mongodb";
export class UpdateManyMessage<T extends Base> implements IReplyMessage {
public error: string;
public jwt: string;
// w: 1 - Requests acknowledgment that the write operation has propagated
// w: 0 - Requests no acknowledgment of the write operation
// w: 2 would require acknowledgment from the primary and one of the secondaries
// w: 3 would require acknowledgment from the primary and both secondaries
public w: number;
// true, requests acknowledgment that the mongod instances have written to the on-disk journal
public j: boolean;
public query: any;
public item: T;
public collectionname: string;
public result: T[];
public opresult: UpdateWriteOpResult;
static assign<T extends Base>(o: any): UpdateManyMessage<T> {
if (typeof o === "string" || o instanceof String) {
return Object.assign(new UpdateManyMessage(), JSON.parse(o.toString()));
}
return Object.assign(new UpdateManyMessage(), o);
}
}