MCPcopy
hub / github.com/mongodb/node-mongodb-native / make

Method make

src/cmap/wire_protocol/responses.ts:103–109  ·  view source on GitHub ↗
(bson: Uint8Array)

Source from the content-addressed store, hash-verified

101 }
102
103 static make(bson: Uint8Array) {
104 const elements = parseToElementsToArray(bson, 0);
105 const isError = isErrorResponse(bson, elements);
106 return isError
107 ? new MongoDBResponse(bson, 0, false, elements)
108 : new this(bson, 0, false, elements);
109 }
110
111 // {ok:1}
112 static empty = new MongoDBResponse(new Uint8Array([13, 0, 0, 0, 16, 111, 107, 0, 1, 0, 0, 0, 0]));

Callers 2

sendWireMethod · 0.80
commandMethod · 0.80

Calls 2

parseToElementsToArrayFunction · 0.90
isErrorResponseFunction · 0.85

Tested by

no test coverage detected