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/src/index.ts CHANGED
@@ -264,8 +264,7 @@ export type {
264
264
  OpMsgResponse,
265
265
  OpQueryOptions,
266
266
  OpQueryRequest,
267
- OpQueryResponse,
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: Document): void {
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.cursor?.atClusterTime || document.atClusterTime;
1060
+ const atClusterTime = document.atClusterTime;
1060
1061
  if (atClusterTime) {
1061
1062
  session[kSnapshotTime] = atClusterTime;
1062
1063
  }