forked from openiap/opencore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInsertOrUpdateOneMessage.ts
More file actions
25 lines (23 loc) · 1.03 KB
/
Copy pathInsertOrUpdateOneMessage.ts
File metadata and controls
25 lines (23 loc) · 1.03 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
import { Base } from "../base";
export class InsertOrUpdateOneMessage<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 uniqeness: string;
public item: T;
public collectionname: string;
public result: T;
public opresult: any;
static assign<T extends Base>(o: any): InsertOrUpdateOneMessage<T> {
if (typeof o === "string" || o instanceof String) {
return Object.assign(new InsertOrUpdateOneMessage(), JSON.parse(o.toString()));
}
return Object.assign(new InsertOrUpdateOneMessage(), o);
}
}