mongodb 6.5.0-dev.20240406.sha.62ea94b → 6.5.0-dev.20240409.sha.30cac05
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bson.js.map +1 -1
- package/lib/cmap/auth/gssapi.js +2 -1
- package/lib/cmap/auth/gssapi.js.map +1 -1
- package/lib/cmap/commands.js +24 -111
- package/lib/cmap/commands.js.map +1 -1
- package/lib/cmap/connect.js +1 -1
- package/lib/cmap/connect.js.map +1 -1
- package/lib/cmap/connection.js +46 -31
- package/lib/cmap/connection.js.map +1 -1
- package/lib/cmap/wire_protocol/compression.js +2 -2
- package/lib/cmap/wire_protocol/compression.js.map +1 -1
- package/lib/cmap/wire_protocol/on_demand/document.js.map +1 -1
- package/lib/cmap/wire_protocol/responses.js +88 -0
- package/lib/cmap/wire_protocol/responses.js.map +1 -0
- package/lib/index.js.map +1 -1
- package/lib/sessions.js +1 -1
- package/lib/sessions.js.map +1 -1
- package/mongodb.d.ts +9 -3
- package/package.json +1 -1
- package/src/bson.ts +1 -0
- package/src/cmap/auth/gssapi.ts +3 -5
- package/src/cmap/commands.ts +28 -132
- package/src/cmap/connect.ts +1 -1
- package/src/cmap/connection.ts +86 -38
- package/src/cmap/wire_protocol/compression.ts +4 -6
- package/src/cmap/wire_protocol/on_demand/document.ts +1 -0
- package/src/cmap/wire_protocol/responses.ts +109 -0
- package/src/index.ts +3 -2
- package/src/sessions.ts +3 -2
package/src/index.ts
CHANGED
|
@@ -264,8 +264,7 @@ export type {
|
|
|
264
264
|
OpMsgResponse,
|
|
265
265
|
OpQueryOptions,
|
|
266
266
|
OpQueryRequest,
|
|
267
|
-
|
|
268
|
-
OpResponseOptions,
|
|
267
|
+
OpReply,
|
|
269
268
|
WriteProtocolMessageType
|
|
270
269
|
} from './cmap/commands';
|
|
271
270
|
export type { HandshakeDocument } from './cmap/connect';
|
|
@@ -290,6 +289,8 @@ export type { ClientMetadata, ClientMetadataOptions } from './cmap/handshake/cli
|
|
|
290
289
|
export type { ConnectionPoolMetrics } from './cmap/metrics';
|
|
291
290
|
export type { StreamDescription, StreamDescriptionOptions } from './cmap/stream_description';
|
|
292
291
|
export type { CompressorName } from './cmap/wire_protocol/compression';
|
|
292
|
+
export type { JSTypeOf, OnDemandDocument } from './cmap/wire_protocol/on_demand/document';
|
|
293
|
+
export type { MongoDBResponse, MongoDBResponseConstructor } from './cmap/wire_protocol/responses';
|
|
293
294
|
export type { CollectionOptions, CollectionPrivate, ModifyResult } from './collection';
|
|
294
295
|
export type {
|
|
295
296
|
COMMAND_FAILED,
|
package/src/sessions.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { promisify } from 'util';
|
|
|
4
4
|
import { Binary, type Document, Long, type Timestamp } from './bson';
|
|
5
5
|
import type { CommandOptions, Connection } from './cmap/connection';
|
|
6
6
|
import { ConnectionPoolMetrics } from './cmap/metrics';
|
|
7
|
+
import { type MongoDBResponse } from './cmap/wire_protocol/responses';
|
|
7
8
|
import { isSharded } from './cmap/wire_protocol/shared';
|
|
8
9
|
import { PINNED, UNPINNED } from './constants';
|
|
9
10
|
import type { AbstractCursor } from './cursor/abstract_cursor';
|
|
@@ -1040,7 +1041,7 @@ export function applySession(
|
|
|
1040
1041
|
return;
|
|
1041
1042
|
}
|
|
1042
1043
|
|
|
1043
|
-
export function updateSessionFromResponse(session: ClientSession, document:
|
|
1044
|
+
export function updateSessionFromResponse(session: ClientSession, document: MongoDBResponse): void {
|
|
1044
1045
|
if (document.$clusterTime) {
|
|
1045
1046
|
_advanceClusterTime(session, document.$clusterTime);
|
|
1046
1047
|
}
|
|
@@ -1056,7 +1057,7 @@ export function updateSessionFromResponse(session: ClientSession, document: Docu
|
|
|
1056
1057
|
if (session?.[kSnapshotEnabled] && session[kSnapshotTime] == null) {
|
|
1057
1058
|
// find and aggregate commands return atClusterTime on the cursor
|
|
1058
1059
|
// distinct includes it in the response body
|
|
1059
|
-
const atClusterTime = document.
|
|
1060
|
+
const atClusterTime = document.atClusterTime;
|
|
1060
1061
|
if (atClusterTime) {
|
|
1061
1062
|
session[kSnapshotTime] = atClusterTime;
|
|
1062
1063
|
}
|