pecunia-root 0.1.1 → 0.1.2
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/dist/adapters/prisma-adapter/index.d.mts +1 -1
- package/dist/adapters/prisma-adapter/index.mjs +1 -1
- package/dist/adapters/prisma-adapter/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +2 -16
- package/dist/_virtual/rolldown_runtime.mjs +0 -8
- package/dist/adapters/mongodb-adapter/index.d.mts +0 -35
- package/dist/adapters/mongodb-adapter/index.mjs +0 -314
- package/dist/adapters/mongodb-adapter/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs +0 -14
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/code-points-data.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs +0 -54
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs +0 -36
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/memory-code-points.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs +0 -27
- package/dist/node_modules/.pnpm/@mongodb-js_saslprep@1.4.4/node_modules/@mongodb-js/saslprep/dist/node.mjs.map +0 -1
- package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs +0 -3728
- package/dist/node_modules/.pnpm/bson@6.10.4/node_modules/bson/lib/bson.mjs.map +0 -1
- package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs +0 -137
- package/dist/node_modules/.pnpm/memory-pager@1.5.0/node_modules/memory-pager/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs +0 -211
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs +0 -95
- package/dist/node_modules/.pnpm/mongodb-connection-string-url@3.0.2/node_modules/mongodb-connection-string-url/lib/redact.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs +0 -158
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/admin.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs +0 -195
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bson.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs +0 -710
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs +0 -53
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs +0 -63
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs +0 -368
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs +0 -234
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs +0 -545
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/client_encryption.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs +0 -83
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs +0 -146
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/errors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs +0 -58
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs +0 -30
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/aws.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs +0 -135
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/azure.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs +0 -25
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/gcp.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs +0 -47
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/providers/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs +0 -362
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/client-side-encryption/state_machine.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs +0 -58
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/auth_provider.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs +0 -123
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs +0 -128
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/gssapi.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs +0 -133
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongo_credentials.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs +0 -126
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_aws.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs +0 -79
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/automated_callback_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs +0 -65
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs +0 -127
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/callback_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs +0 -47
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/command_builders.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs +0 -44
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs +0 -101
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/human_callback_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs +0 -33
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs +0 -53
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_cache.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs +0 -29
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs +0 -83
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs +0 -36
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/plain.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs +0 -32
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/providers.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs +0 -206
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/scram.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs +0 -45
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/auth/x509.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs +0 -213
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/command_monitoring_events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs +0 -411
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/commands.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs +0 -288
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connect.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs +0 -423
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs +0 -483
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs +0 -207
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/connection_pool_events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs +0 -116
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/errors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs +0 -183
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/handshake/client_metadata.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs +0 -55
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/metrics.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs +0 -60
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/stream_description.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs +0 -139
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/compression.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs +0 -28
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/constants.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs +0 -117
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_data.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs +0 -182
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs +0 -304
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/responses.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs +0 -34
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cmap/wire_protocol/shared.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs +0 -739
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs +0 -805
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/connection_string.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs +0 -174
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/constants.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs +0 -726
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/abstract_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs +0 -172
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/aggregation_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs +0 -103
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/change_stream_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs +0 -66
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/client_bulk_write_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs +0 -41
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/explainable_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs +0 -365
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/find_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs +0 -50
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_collections_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs +0 -48
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_indexes_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs +0 -23
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/list_search_indexes_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs +0 -106
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/cursor/run_command_cursor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs +0 -428
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/db.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs +0 -124
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/deps.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs +0 -95
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/encrypter.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs +0 -1305
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/error.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs +0 -59
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/explain.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs +0 -250
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/download.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs +0 -170
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs +0 -315
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/gridfs/upload.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs +0 -925
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs +0 -520
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs +0 -90
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_client_auth_providers.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs +0 -582
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_logger.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs +0 -64
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/mongo_types.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs +0 -86
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/aggregate.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs +0 -60
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/client_bulk_write.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs +0 -264
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/command_builder.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs +0 -109
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/executor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs +0 -172
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/client_bulk_write/results_merger.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs +0 -68
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/command.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs +0 -53
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/count.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs +0 -123
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/create_collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs +0 -119
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/delete.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs +0 -65
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/distinct.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs +0 -97
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/drop.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs +0 -47
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs +0 -188
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/execute_operation.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs +0 -103
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs +0 -136
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs +0 -61
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/get_more.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs +0 -179
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/indexes.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs +0 -77
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/insert.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs +0 -48
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/kill_cursors.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs +0 -60
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_collections.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs +0 -43
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/list_databases.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs +0 -105
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/operation.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs +0 -50
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/profiling_level.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs +0 -39
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/remove_user.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs +0 -49
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/rename.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs +0 -58
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/run_command.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs +0 -46
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/create.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs +0 -48
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/drop.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs +0 -46
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/search_indexes/update.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs +0 -67
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs +0 -37
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/stats.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs +0 -171
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/update.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs +0 -45
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/operations/validate_collection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs +0 -71
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_concern.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs +0 -165
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/read_preference.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs +0 -62
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/resource_management.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs +0 -51
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/common.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs +0 -156
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs +0 -477
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/monitor.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs +0 -315
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs +0 -157
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_description.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs +0 -184
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs +0 -96
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/server_selection_events.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs +0 -107
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/srv_polling.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs +0 -540
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs +0 -298
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sdam/topology_description.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs +0 -623
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sessions.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs +0 -91
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/sort.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs +0 -254
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/timeout.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs +0 -138
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/transactions.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs +0 -993
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/utils.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs +0 -81
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/write_concern.mjs.map +0 -1
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs +0 -171
- package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/package.mjs.map +0 -1
- package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs +0 -295
- package/dist/node_modules/.pnpm/punycode@2.3.1/node_modules/punycode/punycode.mjs.map +0 -1
- package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs +0 -81
- package/dist/node_modules/.pnpm/sparse-bitfield@3.0.3/node_modules/sparse-bitfield/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs +0 -206
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs +0 -33590
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/mappingTable.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs +0 -37
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/regexes.mjs.map +0 -1
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs +0 -18
- package/dist/node_modules/.pnpm/tr46@5.1.1/node_modules/tr46/lib/statusMapping.mjs.map +0 -1
- package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs +0 -252
- package/dist/node_modules/.pnpm/webidl-conversions@7.0.0/node_modules/webidl-conversions/lib/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs +0 -41
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/index.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs +0 -41
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/Function.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs +0 -173
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL-impl.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs +0 -334
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URL.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs +0 -90
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams-impl.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs +0 -356
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/URLSearchParams.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs +0 -23
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/encoding.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs +0 -29
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/infra.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs +0 -140
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/percent-encoding.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs +0 -831
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/url-state-machine.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs +0 -77
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/urlencoded.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs +0 -147
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/lib/utils.mjs.map +0 -1
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs +0 -17
- package/dist/node_modules/.pnpm/whatwg-url@14.2.0/node_modules/whatwg-url/webidl2js-wrapper.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.mjs","names":["writeResult"],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/common.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BulkOperationBase = exports.FindOperators = exports.MongoBulkWriteError = exports.WriteError = exports.WriteConcernError = exports.BulkWriteResult = exports.Batch = exports.BatchType = void 0;\nexports.mergeBatchResults = mergeBatchResults;\nconst bson_1 = require(\"../bson\");\nconst error_1 = require(\"../error\");\nconst delete_1 = require(\"../operations/delete\");\nconst execute_operation_1 = require(\"../operations/execute_operation\");\nconst insert_1 = require(\"../operations/insert\");\nconst update_1 = require(\"../operations/update\");\nconst timeout_1 = require(\"../timeout\");\nconst utils_1 = require(\"../utils\");\nconst write_concern_1 = require(\"../write_concern\");\n/** @public */\nexports.BatchType = Object.freeze({\n INSERT: 1,\n UPDATE: 2,\n DELETE: 3\n});\n/**\n * Keeps the state of a unordered batch so we can rewrite the results\n * correctly after command execution\n *\n * @public\n */\nclass Batch {\n constructor(batchType, originalZeroIndex) {\n this.originalZeroIndex = originalZeroIndex;\n this.currentIndex = 0;\n this.originalIndexes = [];\n this.batchType = batchType;\n this.operations = [];\n this.size = 0;\n this.sizeBytes = 0;\n }\n}\nexports.Batch = Batch;\n/**\n * @public\n * The result of a bulk write.\n */\nclass BulkWriteResult {\n static generateIdMap(ids) {\n const idMap = {};\n for (const doc of ids) {\n idMap[doc.index] = doc._id;\n }\n return idMap;\n }\n /**\n * Create a new BulkWriteResult instance\n * @internal\n */\n constructor(bulkResult, isOrdered) {\n this.result = bulkResult;\n this.insertedCount = this.result.nInserted ?? 0;\n this.matchedCount = this.result.nMatched ?? 0;\n this.modifiedCount = this.result.nModified ?? 0;\n this.deletedCount = this.result.nRemoved ?? 0;\n this.upsertedCount = this.result.upserted.length ?? 0;\n this.upsertedIds = BulkWriteResult.generateIdMap(this.result.upserted);\n this.insertedIds = BulkWriteResult.generateIdMap(this.getSuccessfullyInsertedIds(bulkResult, isOrdered));\n Object.defineProperty(this, 'result', { value: this.result, enumerable: false });\n }\n /** Evaluates to true if the bulk operation correctly executes */\n get ok() {\n return this.result.ok;\n }\n /**\n * Returns document_ids that were actually inserted\n * @internal\n */\n getSuccessfullyInsertedIds(bulkResult, isOrdered) {\n if (bulkResult.writeErrors.length === 0)\n return bulkResult.insertedIds;\n if (isOrdered) {\n return bulkResult.insertedIds.slice(0, bulkResult.writeErrors[0].index);\n }\n return bulkResult.insertedIds.filter(({ index }) => !bulkResult.writeErrors.some(writeError => index === writeError.index));\n }\n /** Returns the upserted id at the given index */\n getUpsertedIdAt(index) {\n return this.result.upserted[index];\n }\n /** Returns raw internal result */\n getRawResponse() {\n return this.result;\n }\n /** Returns true if the bulk operation contains a write error */\n hasWriteErrors() {\n return this.result.writeErrors.length > 0;\n }\n /** Returns the number of write errors from the bulk operation */\n getWriteErrorCount() {\n return this.result.writeErrors.length;\n }\n /** Returns a specific write error object */\n getWriteErrorAt(index) {\n return index < this.result.writeErrors.length ? this.result.writeErrors[index] : undefined;\n }\n /** Retrieve all write errors */\n getWriteErrors() {\n return this.result.writeErrors;\n }\n /** Retrieve the write concern error if one exists */\n getWriteConcernError() {\n if (this.result.writeConcernErrors.length === 0) {\n return;\n }\n else if (this.result.writeConcernErrors.length === 1) {\n // Return the error\n return this.result.writeConcernErrors[0];\n }\n else {\n // Combine the errors\n let errmsg = '';\n for (let i = 0; i < this.result.writeConcernErrors.length; i++) {\n const err = this.result.writeConcernErrors[i];\n errmsg = errmsg + err.errmsg;\n // TODO: Something better\n if (i === 0)\n errmsg = errmsg + ' and ';\n }\n return new WriteConcernError({ errmsg, code: error_1.MONGODB_ERROR_CODES.WriteConcernTimeout });\n }\n }\n toString() {\n return `BulkWriteResult(${bson_1.EJSON.stringify(this.result)})`;\n }\n isOk() {\n return this.result.ok === 1;\n }\n}\nexports.BulkWriteResult = BulkWriteResult;\n/**\n * An error representing a failure by the server to apply the requested write concern to the bulk operation.\n * @public\n * @category Error\n */\nclass WriteConcernError {\n constructor(error) {\n this.serverError = error;\n }\n /** Write concern error code. */\n get code() {\n return this.serverError.code;\n }\n /** Write concern error message. */\n get errmsg() {\n return this.serverError.errmsg;\n }\n /** Write concern error info. */\n get errInfo() {\n return this.serverError.errInfo;\n }\n toJSON() {\n return this.serverError;\n }\n toString() {\n return `WriteConcernError(${this.errmsg})`;\n }\n}\nexports.WriteConcernError = WriteConcernError;\n/**\n * An error that occurred during a BulkWrite on the server.\n * @public\n * @category Error\n */\nclass WriteError {\n constructor(err) {\n this.err = err;\n }\n /** WriteError code. */\n get code() {\n return this.err.code;\n }\n /** WriteError original bulk operation index. */\n get index() {\n return this.err.index;\n }\n /** WriteError message. */\n get errmsg() {\n return this.err.errmsg;\n }\n /** WriteError details. */\n get errInfo() {\n return this.err.errInfo;\n }\n /** Returns the underlying operation that caused the error */\n getOperation() {\n return this.err.op;\n }\n toJSON() {\n return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op };\n }\n toString() {\n return `WriteError(${JSON.stringify(this.toJSON())})`;\n }\n}\nexports.WriteError = WriteError;\n/** Merges results into shared data structure */\nfunction mergeBatchResults(batch, bulkResult, err, result) {\n // If we have an error set the result to be the err object\n if (err) {\n result = err;\n }\n else if (result && result.result) {\n result = result.result;\n }\n if (result == null) {\n return;\n }\n // Do we have a top level error stop processing and return\n if (result.ok === 0 && bulkResult.ok === 1) {\n bulkResult.ok = 0;\n const writeError = {\n index: 0,\n code: result.code || 0,\n errmsg: result.message,\n errInfo: result.errInfo,\n op: batch.operations[0]\n };\n bulkResult.writeErrors.push(new WriteError(writeError));\n return;\n }\n else if (result.ok === 0 && bulkResult.ok === 0) {\n return;\n }\n // If we have an insert Batch type\n if (isInsertBatch(batch) && result.n) {\n bulkResult.nInserted = bulkResult.nInserted + result.n;\n }\n // If we have an insert Batch type\n if (isDeleteBatch(batch) && result.n) {\n bulkResult.nRemoved = bulkResult.nRemoved + result.n;\n }\n let nUpserted = 0;\n // We have an array of upserted values, we need to rewrite the indexes\n if (Array.isArray(result.upserted)) {\n nUpserted = result.upserted.length;\n for (let i = 0; i < result.upserted.length; i++) {\n bulkResult.upserted.push({\n index: result.upserted[i].index + batch.originalZeroIndex,\n _id: result.upserted[i]._id\n });\n }\n }\n else if (result.upserted) {\n nUpserted = 1;\n bulkResult.upserted.push({\n index: batch.originalZeroIndex,\n _id: result.upserted\n });\n }\n // If we have an update Batch type\n if (isUpdateBatch(batch) && result.n) {\n const nModified = result.nModified;\n bulkResult.nUpserted = bulkResult.nUpserted + nUpserted;\n bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted);\n if (typeof nModified === 'number') {\n bulkResult.nModified = bulkResult.nModified + nModified;\n }\n else {\n bulkResult.nModified = 0;\n }\n }\n if (Array.isArray(result.writeErrors)) {\n for (let i = 0; i < result.writeErrors.length; i++) {\n const writeError = {\n index: batch.originalIndexes[result.writeErrors[i].index],\n code: result.writeErrors[i].code,\n errmsg: result.writeErrors[i].errmsg,\n errInfo: result.writeErrors[i].errInfo,\n op: batch.operations[result.writeErrors[i].index]\n };\n bulkResult.writeErrors.push(new WriteError(writeError));\n }\n }\n if (result.writeConcernError) {\n bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError));\n }\n}\nasync function executeCommands(bulkOperation, options) {\n if (bulkOperation.s.batches.length === 0) {\n return new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered);\n }\n for (const batch of bulkOperation.s.batches) {\n const finalOptions = (0, utils_1.resolveOptions)(bulkOperation, {\n ...options,\n ordered: bulkOperation.isOrdered\n });\n if (finalOptions.bypassDocumentValidation !== true) {\n delete finalOptions.bypassDocumentValidation;\n }\n // Is the bypassDocumentValidation options specific\n if (bulkOperation.s.bypassDocumentValidation === true) {\n finalOptions.bypassDocumentValidation = true;\n }\n // Is the checkKeys option disabled\n if (bulkOperation.s.checkKeys === false) {\n finalOptions.checkKeys = false;\n }\n if (finalOptions.retryWrites) {\n if (isUpdateBatch(batch)) {\n finalOptions.retryWrites =\n finalOptions.retryWrites && !batch.operations.some(op => op.multi);\n }\n if (isDeleteBatch(batch)) {\n finalOptions.retryWrites =\n finalOptions.retryWrites && !batch.operations.some(op => op.limit === 0);\n }\n }\n const operation = isInsertBatch(batch)\n ? new insert_1.InsertOperation(bulkOperation.s.namespace, batch.operations, finalOptions)\n : isUpdateBatch(batch)\n ? new update_1.UpdateOperation(bulkOperation.s.namespace, batch.operations, finalOptions)\n : isDeleteBatch(batch)\n ? new delete_1.DeleteOperation(bulkOperation.s.namespace, batch.operations, finalOptions)\n : null;\n if (operation == null)\n throw new error_1.MongoRuntimeError(`Unknown batchType: ${batch.batchType}`);\n let thrownError = null;\n let result;\n try {\n result = await (0, execute_operation_1.executeOperation)(bulkOperation.s.collection.client, operation, finalOptions.timeoutContext);\n }\n catch (error) {\n thrownError = error;\n }\n if (thrownError != null) {\n if (thrownError instanceof error_1.MongoWriteConcernError) {\n mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result);\n const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered);\n throw new MongoBulkWriteError({\n message: thrownError.result.writeConcernError.errmsg,\n code: thrownError.result.writeConcernError.code\n }, writeResult);\n }\n else {\n // Error is a driver related error not a bulk op error, return early\n throw new MongoBulkWriteError(thrownError, new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered));\n }\n }\n mergeBatchResults(batch, bulkOperation.s.bulkResult, thrownError, result);\n const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered);\n bulkOperation.handleWriteError(writeResult);\n }\n bulkOperation.s.batches.length = 0;\n const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult, bulkOperation.isOrdered);\n bulkOperation.handleWriteError(writeResult);\n return writeResult;\n}\n/**\n * An error indicating an unsuccessful Bulk Write\n * @public\n * @category Error\n */\nclass MongoBulkWriteError extends error_1.MongoServerError {\n /**\n * **Do not use this constructor!**\n *\n * Meant for internal use only.\n *\n * @remarks\n * This class is only meant to be constructed within the driver. This constructor is\n * not subject to semantic versioning compatibility guarantees and may change at any time.\n *\n * @public\n **/\n constructor(error, result) {\n super(error);\n this.writeErrors = [];\n if (error instanceof WriteConcernError)\n this.err = error;\n else if (!(error instanceof Error)) {\n this.message = error.message;\n this.code = error.code;\n this.writeErrors = error.writeErrors ?? [];\n }\n this.result = result;\n Object.assign(this, error);\n }\n get name() {\n return 'MongoBulkWriteError';\n }\n /** Number of documents inserted. */\n get insertedCount() {\n return this.result.insertedCount;\n }\n /** Number of documents matched for update. */\n get matchedCount() {\n return this.result.matchedCount;\n }\n /** Number of documents modified. */\n get modifiedCount() {\n return this.result.modifiedCount;\n }\n /** Number of documents deleted. */\n get deletedCount() {\n return this.result.deletedCount;\n }\n /** Number of documents upserted. */\n get upsertedCount() {\n return this.result.upsertedCount;\n }\n /** Inserted document generated Id's, hash key is the index of the originating operation */\n get insertedIds() {\n return this.result.insertedIds;\n }\n /** Upserted document generated Id's, hash key is the index of the originating operation */\n get upsertedIds() {\n return this.result.upsertedIds;\n }\n}\nexports.MongoBulkWriteError = MongoBulkWriteError;\n/**\n * A builder object that is returned from {@link BulkOperationBase#find}.\n * Is used to build a write operation that involves a query filter.\n *\n * @public\n */\nclass FindOperators {\n /**\n * Creates a new FindOperators object.\n * @internal\n */\n constructor(bulkOperation) {\n this.bulkOperation = bulkOperation;\n }\n /** Add a multiple update operation to the bulk operation */\n update(updateDocument) {\n const currentOp = buildCurrentOp(this.bulkOperation);\n return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, {\n ...currentOp,\n multi: true\n }));\n }\n /** Add a single update operation to the bulk operation */\n updateOne(updateDocument) {\n if (!(0, utils_1.hasAtomicOperators)(updateDocument, this.bulkOperation.bsonOptions)) {\n throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators');\n }\n const currentOp = buildCurrentOp(this.bulkOperation);\n return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, { ...currentOp, multi: false }));\n }\n /** Add a replace one operation to the bulk operation */\n replaceOne(replacement) {\n if ((0, utils_1.hasAtomicOperators)(replacement)) {\n throw new error_1.MongoInvalidArgumentError('Replacement document must not use atomic operators');\n }\n const currentOp = buildCurrentOp(this.bulkOperation);\n return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, replacement, { ...currentOp, multi: false }));\n }\n /** Add a delete one operation to the bulk operation */\n deleteOne() {\n const currentOp = buildCurrentOp(this.bulkOperation);\n return this.bulkOperation.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 1 }));\n }\n /** Add a delete many operation to the bulk operation */\n delete() {\n const currentOp = buildCurrentOp(this.bulkOperation);\n return this.bulkOperation.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 0 }));\n }\n /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */\n upsert() {\n if (!this.bulkOperation.s.currentOp) {\n this.bulkOperation.s.currentOp = {};\n }\n this.bulkOperation.s.currentOp.upsert = true;\n return this;\n }\n /** Specifies the collation for the query condition. */\n collation(collation) {\n if (!this.bulkOperation.s.currentOp) {\n this.bulkOperation.s.currentOp = {};\n }\n this.bulkOperation.s.currentOp.collation = collation;\n return this;\n }\n /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */\n arrayFilters(arrayFilters) {\n if (!this.bulkOperation.s.currentOp) {\n this.bulkOperation.s.currentOp = {};\n }\n this.bulkOperation.s.currentOp.arrayFilters = arrayFilters;\n return this;\n }\n /** Specifies hint for the bulk operation. */\n hint(hint) {\n if (!this.bulkOperation.s.currentOp) {\n this.bulkOperation.s.currentOp = {};\n }\n this.bulkOperation.s.currentOp.hint = hint;\n return this;\n }\n}\nexports.FindOperators = FindOperators;\n/** @public */\nclass BulkOperationBase {\n /**\n * Create a new OrderedBulkOperation or UnorderedBulkOperation instance\n * @internal\n */\n constructor(collection, options, isOrdered) {\n this.collection = collection;\n // determine whether bulkOperation is ordered or unordered\n this.isOrdered = isOrdered;\n const topology = (0, utils_1.getTopology)(collection);\n options = options == null ? {} : options;\n // TODO Bring from driver information in hello\n // Get the namespace for the write operations\n const namespace = collection.s.namespace;\n // Used to mark operation as executed\n const executed = false;\n // Current item\n const currentOp = undefined;\n // Set max byte size\n const hello = topology.lastHello();\n // If we have autoEncryption on, batch-splitting must be done on 2mb chunks, but single documents\n // over 2mb are still allowed\n const usingAutoEncryption = !!(topology.s.options && topology.s.options.autoEncrypter);\n const maxBsonObjectSize = hello && hello.maxBsonObjectSize ? hello.maxBsonObjectSize : 1024 * 1024 * 16;\n const maxBatchSizeBytes = usingAutoEncryption ? 1024 * 1024 * 2 : maxBsonObjectSize;\n const maxWriteBatchSize = hello && hello.maxWriteBatchSize ? hello.maxWriteBatchSize : 1000;\n // Calculates the largest possible size of an Array key, represented as a BSON string\n // element. This calculation:\n // 1 byte for BSON type\n // # of bytes = length of (string representation of (maxWriteBatchSize - 1))\n // + 1 bytes for null terminator\n const maxKeySize = (maxWriteBatchSize - 1).toString(10).length + 2;\n // Final options for retryable writes\n let finalOptions = Object.assign({}, options);\n finalOptions = (0, utils_1.applyRetryableWrites)(finalOptions, collection.db);\n // Final results\n const bulkResult = {\n ok: 1,\n writeErrors: [],\n writeConcernErrors: [],\n insertedIds: [],\n nInserted: 0,\n nUpserted: 0,\n nMatched: 0,\n nModified: 0,\n nRemoved: 0,\n upserted: []\n };\n // Internal state\n this.s = {\n // Final result\n bulkResult,\n // Current batch state\n currentBatch: undefined,\n currentIndex: 0,\n // ordered specific\n currentBatchSize: 0,\n currentBatchSizeBytes: 0,\n // unordered specific\n currentInsertBatch: undefined,\n currentUpdateBatch: undefined,\n currentRemoveBatch: undefined,\n batches: [],\n // Write concern\n writeConcern: write_concern_1.WriteConcern.fromOptions(options),\n // Max batch size options\n maxBsonObjectSize,\n maxBatchSizeBytes,\n maxWriteBatchSize,\n maxKeySize,\n // Namespace\n namespace,\n // Topology\n topology,\n // Options\n options: finalOptions,\n // BSON options\n bsonOptions: (0, bson_1.resolveBSONOptions)(options),\n // Current operation\n currentOp,\n // Executed\n executed,\n // Collection\n collection,\n // Fundamental error\n err: undefined,\n // check keys\n checkKeys: typeof options.checkKeys === 'boolean' ? options.checkKeys : false\n };\n // bypass Validation\n if (options.bypassDocumentValidation === true) {\n this.s.bypassDocumentValidation = true;\n }\n }\n /**\n * Add a single insert document to the bulk operation\n *\n * @example\n * ```ts\n * const bulkOp = collection.initializeOrderedBulkOp();\n *\n * // Adds three inserts to the bulkOp.\n * bulkOp\n * .insert({ a: 1 })\n * .insert({ b: 2 })\n * .insert({ c: 3 });\n * await bulkOp.execute();\n * ```\n */\n insert(document) {\n (0, utils_1.maybeAddIdToDocuments)(this.collection, document, {\n forceServerObjectId: this.shouldForceServerObjectId()\n });\n return this.addToOperationsList(exports.BatchType.INSERT, document);\n }\n /**\n * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne.\n * Returns a builder object used to complete the definition of the operation.\n *\n * @example\n * ```ts\n * const bulkOp = collection.initializeOrderedBulkOp();\n *\n * // Add an updateOne to the bulkOp\n * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } });\n *\n * // Add an updateMany to the bulkOp\n * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } });\n *\n * // Add an upsert\n * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } });\n *\n * // Add a deletion\n * bulkOp.find({ g: 7 }).deleteOne();\n *\n * // Add a multi deletion\n * bulkOp.find({ h: 8 }).delete();\n *\n * // Add a replaceOne\n * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }});\n *\n * // Update using a pipeline (requires Mongodb 4.2 or higher)\n * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([\n * { $set: { total: { $sum: [ '$y', '$z' ] } } }\n * ]);\n *\n * // All of the ops will now be executed\n * await bulkOp.execute();\n * ```\n */\n find(selector) {\n if (!selector) {\n throw new error_1.MongoInvalidArgumentError('Bulk find operation must specify a selector');\n }\n // Save a current selector\n this.s.currentOp = {\n selector: selector\n };\n return new FindOperators(this);\n }\n /** Specifies a raw operation to perform in the bulk write. */\n raw(op) {\n if (op == null || typeof op !== 'object') {\n throw new error_1.MongoInvalidArgumentError('Operation must be an object with an operation key');\n }\n if ('insertOne' in op) {\n const forceServerObjectId = this.shouldForceServerObjectId();\n const document = op.insertOne && op.insertOne.document == null\n ? // TODO(NODE-6003): remove support for omitting the `documents` subdocument in bulk inserts\n op.insertOne\n : op.insertOne.document;\n (0, utils_1.maybeAddIdToDocuments)(this.collection, document, { forceServerObjectId });\n return this.addToOperationsList(exports.BatchType.INSERT, document);\n }\n if ('replaceOne' in op || 'updateOne' in op || 'updateMany' in op) {\n if ('replaceOne' in op) {\n if ('q' in op.replaceOne) {\n throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed');\n }\n const updateStatement = (0, update_1.makeUpdateStatement)(op.replaceOne.filter, op.replaceOne.replacement, { ...op.replaceOne, multi: false });\n if ((0, utils_1.hasAtomicOperators)(updateStatement.u)) {\n throw new error_1.MongoInvalidArgumentError('Replacement document must not use atomic operators');\n }\n return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement);\n }\n if ('updateOne' in op) {\n if ('q' in op.updateOne) {\n throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed');\n }\n const updateStatement = (0, update_1.makeUpdateStatement)(op.updateOne.filter, op.updateOne.update, {\n ...op.updateOne,\n multi: false\n });\n if (!(0, utils_1.hasAtomicOperators)(updateStatement.u, this.bsonOptions)) {\n throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators');\n }\n return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement);\n }\n if ('updateMany' in op) {\n if ('q' in op.updateMany) {\n throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed');\n }\n const updateStatement = (0, update_1.makeUpdateStatement)(op.updateMany.filter, op.updateMany.update, {\n ...op.updateMany,\n multi: true\n });\n if (!(0, utils_1.hasAtomicOperators)(updateStatement.u, this.bsonOptions)) {\n throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators');\n }\n return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement);\n }\n }\n if ('deleteOne' in op) {\n if ('q' in op.deleteOne) {\n throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed');\n }\n return this.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op.deleteOne.filter, { ...op.deleteOne, limit: 1 }));\n }\n if ('deleteMany' in op) {\n if ('q' in op.deleteMany) {\n throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed');\n }\n return this.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op.deleteMany.filter, { ...op.deleteMany, limit: 0 }));\n }\n // otherwise an unknown operation was provided\n throw new error_1.MongoInvalidArgumentError('bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany');\n }\n get length() {\n return this.s.currentIndex;\n }\n get bsonOptions() {\n return this.s.bsonOptions;\n }\n get writeConcern() {\n return this.s.writeConcern;\n }\n get batches() {\n const batches = [...this.s.batches];\n if (this.isOrdered) {\n if (this.s.currentBatch)\n batches.push(this.s.currentBatch);\n }\n else {\n if (this.s.currentInsertBatch)\n batches.push(this.s.currentInsertBatch);\n if (this.s.currentUpdateBatch)\n batches.push(this.s.currentUpdateBatch);\n if (this.s.currentRemoveBatch)\n batches.push(this.s.currentRemoveBatch);\n }\n return batches;\n }\n async execute(options = {}) {\n if (this.s.executed) {\n throw new error_1.MongoBatchReExecutionError();\n }\n const writeConcern = write_concern_1.WriteConcern.fromOptions(options);\n if (writeConcern) {\n this.s.writeConcern = writeConcern;\n }\n // If we have current batch\n if (this.isOrdered) {\n if (this.s.currentBatch)\n this.s.batches.push(this.s.currentBatch);\n }\n else {\n if (this.s.currentInsertBatch)\n this.s.batches.push(this.s.currentInsertBatch);\n if (this.s.currentUpdateBatch)\n this.s.batches.push(this.s.currentUpdateBatch);\n if (this.s.currentRemoveBatch)\n this.s.batches.push(this.s.currentRemoveBatch);\n }\n // If we have no operations in the bulk raise an error\n if (this.s.batches.length === 0) {\n throw new error_1.MongoInvalidArgumentError('Invalid BulkOperation, Batch cannot be empty');\n }\n this.s.executed = true;\n const finalOptions = (0, utils_1.resolveOptions)(this.collection, { ...this.s.options, ...options });\n // if there is no timeoutContext provided, create a timeoutContext and use it for\n // all batches in the bulk operation\n finalOptions.timeoutContext ??= timeout_1.TimeoutContext.create({\n session: finalOptions.session,\n timeoutMS: finalOptions.timeoutMS,\n serverSelectionTimeoutMS: this.collection.client.s.options.serverSelectionTimeoutMS,\n waitQueueTimeoutMS: this.collection.client.s.options.waitQueueTimeoutMS\n });\n if (finalOptions.session == null) {\n // if there is not an explicit session provided to `execute()`, create\n // an implicit session and use that for all batches in the bulk operation\n return await this.collection.client.withSession({ explicit: false }, async (session) => {\n return await executeCommands(this, { ...finalOptions, session });\n });\n }\n return await executeCommands(this, { ...finalOptions });\n }\n /**\n * Handles the write error before executing commands\n * @internal\n */\n handleWriteError(writeResult) {\n if (this.s.bulkResult.writeErrors.length > 0) {\n const msg = this.s.bulkResult.writeErrors[0].errmsg\n ? this.s.bulkResult.writeErrors[0].errmsg\n : 'write operation failed';\n throw new MongoBulkWriteError({\n message: msg,\n code: this.s.bulkResult.writeErrors[0].code,\n writeErrors: this.s.bulkResult.writeErrors\n }, writeResult);\n }\n const writeConcernError = writeResult.getWriteConcernError();\n if (writeConcernError) {\n throw new MongoBulkWriteError(writeConcernError, writeResult);\n }\n }\n shouldForceServerObjectId() {\n return (this.s.options.forceServerObjectId === true ||\n this.s.collection.db.options?.forceServerObjectId === true);\n }\n}\nexports.BulkOperationBase = BulkOperationBase;\nfunction isInsertBatch(batch) {\n return batch.batchType === exports.BatchType.INSERT;\n}\nfunction isUpdateBatch(batch) {\n return batch.batchType === exports.BatchType.UPDATE;\n}\nfunction isDeleteBatch(batch) {\n return batch.batchType === exports.BatchType.DELETE;\n}\nfunction buildCurrentOp(bulkOp) {\n let { currentOp } = bulkOp.s;\n bulkOp.s.currentOp = undefined;\n if (!currentOp)\n currentOp = {};\n return currentOp;\n}\n//# sourceMappingURL=common.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,oBAAoB,QAAQ,gBAAgB,QAAQ,sBAAsB,QAAQ,aAAa,QAAQ,oBAAoB,QAAQ,kBAAkB,QAAQ,QAAQ,QAAQ,YAAY,KAAK;AACtM,SAAQ,oBAAoB;CAC5B,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;;AAEN,SAAQ,YAAY,OAAO,OAAO;EAC9B,QAAQ;EACR,QAAQ;EACR,QAAQ;EACX,CAAC;;;;;;;CAOF,IAAM,QAAN,MAAY;EACR,YAAY,WAAW,mBAAmB;AACtC,QAAK,oBAAoB;AACzB,QAAK,eAAe;AACpB,QAAK,kBAAkB,EAAE;AACzB,QAAK,YAAY;AACjB,QAAK,aAAa,EAAE;AACpB,QAAK,OAAO;AACZ,QAAK,YAAY;;;AAGzB,SAAQ,QAAQ;;;;;CAKhB,IAAM,kBAAN,MAAM,gBAAgB;EAClB,OAAO,cAAc,KAAK;GACtB,MAAM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AAE,GAAG,cAAc,CAAC;;;;;;EAM3D,iBAAiB,aAAa;AAC1B,OAAI,KAAK,EAAE,WAAW,YAAY,SAAS,EAIvC,OAAM,IAAI,oBAAoB;IAC1B,SAJQ,KAAK,EAAE,WAAW,YAAY,GAAG,SACvC,KAAK,EAAE,WAAW,YAAY,GAAG,SACjC;IAGF,MAAM,KAAK,EAAE,WAAW,YAAY,GAAG;IACvC,aAAa,KAAK,EAAE,WAAW;IAClC,EAAE,YAAY;GAEnB,MAAM,oBAAoB,YAAY,sBAAsB;AAC5D,OAAI,kBACA,OAAM,IAAI,oBAAoB,mBAAmB,YAAY;;EAGrE,4BAA4B;AACxB,UAAQ,KAAK,EAAE,QAAQ,wBAAwB,QAC3C,KAAK,EAAE,WAAW,GAAG,SAAS,wBAAwB;;;AAGlE,SAAQ,oBAAoB;CAC5B,SAAS,cAAc,OAAO;AAC1B,SAAO,MAAM,cAAc,QAAQ,UAAU;;CAEjD,SAAS,cAAc,OAAO;AAC1B,SAAO,MAAM,cAAc,QAAQ,UAAU;;CAEjD,SAAS,cAAc,OAAO;AAC1B,SAAO,MAAM,cAAc,QAAQ,UAAU;;CAEjD,SAAS,eAAe,QAAQ;EAC5B,IAAI,EAAE,cAAc,OAAO;AAC3B,SAAO,EAAE,YAAY;AACrB,MAAI,CAAC,UACD,aAAY,EAAE;AAClB,SAAO"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_bson } from "../bson.mjs";
|
|
3
|
-
import { require_error } from "../error.mjs";
|
|
4
|
-
import { require_common } from "./common.mjs";
|
|
5
|
-
|
|
6
|
-
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.js
|
|
7
|
-
var require_ordered = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.OrderedBulkOperation = void 0;
|
|
10
|
-
const BSON = require_bson();
|
|
11
|
-
const error_1 = require_error();
|
|
12
|
-
const common_1 = require_common();
|
|
13
|
-
/** @public */
|
|
14
|
-
var OrderedBulkOperation = class extends common_1.BulkOperationBase {
|
|
15
|
-
/** @internal */
|
|
16
|
-
constructor(collection, options) {
|
|
17
|
-
super(collection, options, true);
|
|
18
|
-
}
|
|
19
|
-
addToOperationsList(batchType, document) {
|
|
20
|
-
const bsonSize = BSON.calculateObjectSize(document, {
|
|
21
|
-
checkKeys: false,
|
|
22
|
-
ignoreUndefined: false
|
|
23
|
-
});
|
|
24
|
-
if (bsonSize >= this.s.maxBsonObjectSize) throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);
|
|
25
|
-
if (this.s.currentBatch == null) this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);
|
|
26
|
-
const maxKeySize = this.s.maxKeySize;
|
|
27
|
-
if (this.s.currentBatchSize + 1 >= this.s.maxWriteBatchSize || this.s.currentBatchSize > 0 && this.s.currentBatchSizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes || this.s.currentBatch.batchType !== batchType) {
|
|
28
|
-
this.s.batches.push(this.s.currentBatch);
|
|
29
|
-
this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);
|
|
30
|
-
this.s.currentBatchSize = 0;
|
|
31
|
-
this.s.currentBatchSizeBytes = 0;
|
|
32
|
-
}
|
|
33
|
-
if (batchType === common_1.BatchType.INSERT) this.s.bulkResult.insertedIds.push({
|
|
34
|
-
index: this.s.currentIndex,
|
|
35
|
-
_id: document._id
|
|
36
|
-
});
|
|
37
|
-
if (Array.isArray(document)) throw new error_1.MongoInvalidArgumentError("Operation passed in cannot be an Array");
|
|
38
|
-
this.s.currentBatch.originalIndexes.push(this.s.currentIndex);
|
|
39
|
-
this.s.currentBatch.operations.push(document);
|
|
40
|
-
this.s.currentBatchSize += 1;
|
|
41
|
-
this.s.currentBatchSizeBytes += maxKeySize + bsonSize;
|
|
42
|
-
this.s.currentIndex += 1;
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.OrderedBulkOperation = OrderedBulkOperation;
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
export default require_ordered();
|
|
51
|
-
|
|
52
|
-
export { require_ordered };
|
|
53
|
-
//# sourceMappingURL=ordered.mjs.map
|
package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ordered.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/ordered.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OrderedBulkOperation = void 0;\nconst BSON = require(\"../bson\");\nconst error_1 = require(\"../error\");\nconst common_1 = require(\"./common\");\n/** @public */\nclass OrderedBulkOperation extends common_1.BulkOperationBase {\n /** @internal */\n constructor(collection, options) {\n super(collection, options, true);\n }\n addToOperationsList(batchType, document) {\n // Get the bsonSize\n const bsonSize = BSON.calculateObjectSize(document, {\n checkKeys: false,\n // Since we don't know what the user selected for BSON options here,\n // err on the safe side, and check the size with ignoreUndefined: false.\n ignoreUndefined: false\n });\n // Throw error if the doc is bigger than the max BSON size\n if (bsonSize >= this.s.maxBsonObjectSize)\n // TODO(NODE-3483): Change this to MongoBSONError\n throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);\n // Create a new batch object if we don't have a current one\n if (this.s.currentBatch == null) {\n this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);\n }\n const maxKeySize = this.s.maxKeySize;\n // Check if we need to create a new batch\n if (\n // New batch if we exceed the max batch op size\n this.s.currentBatchSize + 1 >= this.s.maxWriteBatchSize ||\n // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc,\n // since we can't sent an empty batch\n (this.s.currentBatchSize > 0 &&\n this.s.currentBatchSizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) ||\n // New batch if the new op does not have the same op type as the current batch\n this.s.currentBatch.batchType !== batchType) {\n // Save the batch to the execution stack\n this.s.batches.push(this.s.currentBatch);\n // Create a new batch\n this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);\n // Reset the current size trackers\n this.s.currentBatchSize = 0;\n this.s.currentBatchSizeBytes = 0;\n }\n if (batchType === common_1.BatchType.INSERT) {\n this.s.bulkResult.insertedIds.push({\n index: this.s.currentIndex,\n _id: document._id\n });\n }\n // We have an array of documents\n if (Array.isArray(document)) {\n throw new error_1.MongoInvalidArgumentError('Operation passed in cannot be an Array');\n }\n this.s.currentBatch.originalIndexes.push(this.s.currentIndex);\n this.s.currentBatch.operations.push(document);\n this.s.currentBatchSize += 1;\n this.s.currentBatchSizeBytes += maxKeySize + bsonSize;\n this.s.currentIndex += 1;\n return this;\n }\n}\nexports.OrderedBulkOperation = OrderedBulkOperation;\n//# sourceMappingURL=ordered.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,uBAAuB,KAAK;CACpC,MAAM;CACN,MAAM;CACN,MAAM;;CAEN,IAAM,uBAAN,cAAmC,SAAS,kBAAkB;;EAE1D,YAAY,YAAY,SAAS;AAC7B,SAAM,YAAY,SAAS,KAAK;;EAEpC,oBAAoB,WAAW,UAAU;GAErC,MAAM,WAAW,KAAK,oBAAoB,UAAU;IAChD,WAAW;IAGX,iBAAiB;IACpB,CAAC;AAEF,OAAI,YAAY,KAAK,EAAE,kBAEnB,OAAM,IAAI,QAAQ,0BAA0B,4CAA4C,KAAK,EAAE,oBAAoB;AAEvH,OAAI,KAAK,EAAE,gBAAgB,KACvB,MAAK,EAAE,eAAe,IAAI,SAAS,MAAM,WAAW,KAAK,EAAE,aAAa;GAE5E,MAAM,aAAa,KAAK,EAAE;AAE1B,OAEA,KAAK,EAAE,mBAAmB,KAAK,KAAK,EAAE,qBAGjC,KAAK,EAAE,mBAAmB,KACvB,KAAK,EAAE,wBAAwB,aAAa,YAAY,KAAK,EAAE,qBAEnE,KAAK,EAAE,aAAa,cAAc,WAAW;AAE7C,SAAK,EAAE,QAAQ,KAAK,KAAK,EAAE,aAAa;AAExC,SAAK,EAAE,eAAe,IAAI,SAAS,MAAM,WAAW,KAAK,EAAE,aAAa;AAExE,SAAK,EAAE,mBAAmB;AAC1B,SAAK,EAAE,wBAAwB;;AAEnC,OAAI,cAAc,SAAS,UAAU,OACjC,MAAK,EAAE,WAAW,YAAY,KAAK;IAC/B,OAAO,KAAK,EAAE;IACd,KAAK,SAAS;IACjB,CAAC;AAGN,OAAI,MAAM,QAAQ,SAAS,CACvB,OAAM,IAAI,QAAQ,0BAA0B,yCAAyC;AAEzF,QAAK,EAAE,aAAa,gBAAgB,KAAK,KAAK,EAAE,aAAa;AAC7D,QAAK,EAAE,aAAa,WAAW,KAAK,SAAS;AAC7C,QAAK,EAAE,oBAAoB;AAC3B,QAAK,EAAE,yBAAyB,aAAa;AAC7C,QAAK,EAAE,gBAAgB;AACvB,UAAO;;;AAGf,SAAQ,uBAAuB"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_bson } from "../bson.mjs";
|
|
3
|
-
import { require_error } from "../error.mjs";
|
|
4
|
-
import { require_common } from "./common.mjs";
|
|
5
|
-
|
|
6
|
-
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.js
|
|
7
|
-
var require_unordered = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.UnorderedBulkOperation = void 0;
|
|
10
|
-
const BSON = require_bson();
|
|
11
|
-
const error_1 = require_error();
|
|
12
|
-
const common_1 = require_common();
|
|
13
|
-
/** @public */
|
|
14
|
-
var UnorderedBulkOperation = class extends common_1.BulkOperationBase {
|
|
15
|
-
/** @internal */
|
|
16
|
-
constructor(collection, options) {
|
|
17
|
-
super(collection, options, false);
|
|
18
|
-
}
|
|
19
|
-
handleWriteError(writeResult) {
|
|
20
|
-
if (this.s.batches.length) return;
|
|
21
|
-
return super.handleWriteError(writeResult);
|
|
22
|
-
}
|
|
23
|
-
addToOperationsList(batchType, document) {
|
|
24
|
-
const bsonSize = BSON.calculateObjectSize(document, {
|
|
25
|
-
checkKeys: false,
|
|
26
|
-
ignoreUndefined: false
|
|
27
|
-
});
|
|
28
|
-
if (bsonSize >= this.s.maxBsonObjectSize) throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);
|
|
29
|
-
this.s.currentBatch = void 0;
|
|
30
|
-
if (batchType === common_1.BatchType.INSERT) this.s.currentBatch = this.s.currentInsertBatch;
|
|
31
|
-
else if (batchType === common_1.BatchType.UPDATE) this.s.currentBatch = this.s.currentUpdateBatch;
|
|
32
|
-
else if (batchType === common_1.BatchType.DELETE) this.s.currentBatch = this.s.currentRemoveBatch;
|
|
33
|
-
const maxKeySize = this.s.maxKeySize;
|
|
34
|
-
if (this.s.currentBatch == null) this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);
|
|
35
|
-
if (this.s.currentBatch.size + 1 >= this.s.maxWriteBatchSize || this.s.currentBatch.size > 0 && this.s.currentBatch.sizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes || this.s.currentBatch.batchType !== batchType) {
|
|
36
|
-
this.s.batches.push(this.s.currentBatch);
|
|
37
|
-
this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);
|
|
38
|
-
}
|
|
39
|
-
if (Array.isArray(document)) throw new error_1.MongoInvalidArgumentError("Operation passed in cannot be an Array");
|
|
40
|
-
this.s.currentBatch.operations.push(document);
|
|
41
|
-
this.s.currentBatch.originalIndexes.push(this.s.currentIndex);
|
|
42
|
-
this.s.currentIndex = this.s.currentIndex + 1;
|
|
43
|
-
if (batchType === common_1.BatchType.INSERT) {
|
|
44
|
-
this.s.currentInsertBatch = this.s.currentBatch;
|
|
45
|
-
this.s.bulkResult.insertedIds.push({
|
|
46
|
-
index: this.s.bulkResult.insertedIds.length,
|
|
47
|
-
_id: document._id
|
|
48
|
-
});
|
|
49
|
-
} else if (batchType === common_1.BatchType.UPDATE) this.s.currentUpdateBatch = this.s.currentBatch;
|
|
50
|
-
else if (batchType === common_1.BatchType.DELETE) this.s.currentRemoveBatch = this.s.currentBatch;
|
|
51
|
-
this.s.currentBatch.size += 1;
|
|
52
|
-
this.s.currentBatch.sizeBytes += maxKeySize + bsonSize;
|
|
53
|
-
return this;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
exports.UnorderedBulkOperation = UnorderedBulkOperation;
|
|
57
|
-
}));
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
export default require_unordered();
|
|
61
|
-
|
|
62
|
-
export { require_unordered };
|
|
63
|
-
//# sourceMappingURL=unordered.mjs.map
|
package/dist/node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unordered.mjs","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/bulk/unordered.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnorderedBulkOperation = void 0;\nconst BSON = require(\"../bson\");\nconst error_1 = require(\"../error\");\nconst common_1 = require(\"./common\");\n/** @public */\nclass UnorderedBulkOperation extends common_1.BulkOperationBase {\n /** @internal */\n constructor(collection, options) {\n super(collection, options, false);\n }\n handleWriteError(writeResult) {\n if (this.s.batches.length) {\n return;\n }\n return super.handleWriteError(writeResult);\n }\n addToOperationsList(batchType, document) {\n // Get the bsonSize\n const bsonSize = BSON.calculateObjectSize(document, {\n checkKeys: false,\n // Since we don't know what the user selected for BSON options here,\n // err on the safe side, and check the size with ignoreUndefined: false.\n ignoreUndefined: false\n });\n // Throw error if the doc is bigger than the max BSON size\n if (bsonSize >= this.s.maxBsonObjectSize) {\n // TODO(NODE-3483): Change this to MongoBSONError\n throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`);\n }\n // Holds the current batch\n this.s.currentBatch = undefined;\n // Get the right type of batch\n if (batchType === common_1.BatchType.INSERT) {\n this.s.currentBatch = this.s.currentInsertBatch;\n }\n else if (batchType === common_1.BatchType.UPDATE) {\n this.s.currentBatch = this.s.currentUpdateBatch;\n }\n else if (batchType === common_1.BatchType.DELETE) {\n this.s.currentBatch = this.s.currentRemoveBatch;\n }\n const maxKeySize = this.s.maxKeySize;\n // Create a new batch object if we don't have a current one\n if (this.s.currentBatch == null) {\n this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);\n }\n // Check if we need to create a new batch\n if (\n // New batch if we exceed the max batch op size\n this.s.currentBatch.size + 1 >= this.s.maxWriteBatchSize ||\n // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc,\n // since we can't sent an empty batch\n (this.s.currentBatch.size > 0 &&\n this.s.currentBatch.sizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) ||\n // New batch if the new op does not have the same op type as the current batch\n this.s.currentBatch.batchType !== batchType) {\n // Save the batch to the execution stack\n this.s.batches.push(this.s.currentBatch);\n // Create a new batch\n this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex);\n }\n // We have an array of documents\n if (Array.isArray(document)) {\n throw new error_1.MongoInvalidArgumentError('Operation passed in cannot be an Array');\n }\n this.s.currentBatch.operations.push(document);\n this.s.currentBatch.originalIndexes.push(this.s.currentIndex);\n this.s.currentIndex = this.s.currentIndex + 1;\n // Save back the current Batch to the right type\n if (batchType === common_1.BatchType.INSERT) {\n this.s.currentInsertBatch = this.s.currentBatch;\n this.s.bulkResult.insertedIds.push({\n index: this.s.bulkResult.insertedIds.length,\n _id: document._id\n });\n }\n else if (batchType === common_1.BatchType.UPDATE) {\n this.s.currentUpdateBatch = this.s.currentBatch;\n }\n else if (batchType === common_1.BatchType.DELETE) {\n this.s.currentRemoveBatch = this.s.currentBatch;\n }\n // Update current batch size\n this.s.currentBatch.size += 1;\n this.s.currentBatch.sizeBytes += maxKeySize + bsonSize;\n return this;\n }\n}\nexports.UnorderedBulkOperation = UnorderedBulkOperation;\n//# sourceMappingURL=unordered.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AACA,QAAO,eAAe,SAAS,cAAc,EAAE,OAAO,MAAM,CAAC;AAC7D,SAAQ,yBAAyB,KAAK;CACtC,MAAM;CACN,MAAM;CACN,MAAM;;CAEN,IAAM,yBAAN,cAAqC,SAAS,kBAAkB;;EAE5D,YAAY,YAAY,SAAS;AAC7B,SAAM,YAAY,SAAS,MAAM;;EAErC,iBAAiB,aAAa;AAC1B,OAAI,KAAK,EAAE,QAAQ,OACf;AAEJ,UAAO,MAAM,iBAAiB,YAAY;;EAE9C,oBAAoB,WAAW,UAAU;GAErC,MAAM,WAAW,KAAK,oBAAoB,UAAU;IAChD,WAAW;IAGX,iBAAiB;IACpB,CAAC;AAEF,OAAI,YAAY,KAAK,EAAE,kBAEnB,OAAM,IAAI,QAAQ,0BAA0B,4CAA4C,KAAK,EAAE,oBAAoB;AAGvH,QAAK,EAAE,eAAe;AAEtB,OAAI,cAAc,SAAS,UAAU,OACjC,MAAK,EAAE,eAAe,KAAK,EAAE;YAExB,cAAc,SAAS,UAAU,OACtC,MAAK,EAAE,eAAe,KAAK,EAAE;YAExB,cAAc,SAAS,UAAU,OACtC,MAAK,EAAE,eAAe,KAAK,EAAE;GAEjC,MAAM,aAAa,KAAK,EAAE;AAE1B,OAAI,KAAK,EAAE,gBAAgB,KACvB,MAAK,EAAE,eAAe,IAAI,SAAS,MAAM,WAAW,KAAK,EAAE,aAAa;AAG5E,OAEA,KAAK,EAAE,aAAa,OAAO,KAAK,KAAK,EAAE,qBAGlC,KAAK,EAAE,aAAa,OAAO,KACxB,KAAK,EAAE,aAAa,YAAY,aAAa,YAAY,KAAK,EAAE,qBAEpE,KAAK,EAAE,aAAa,cAAc,WAAW;AAE7C,SAAK,EAAE,QAAQ,KAAK,KAAK,EAAE,aAAa;AAExC,SAAK,EAAE,eAAe,IAAI,SAAS,MAAM,WAAW,KAAK,EAAE,aAAa;;AAG5E,OAAI,MAAM,QAAQ,SAAS,CACvB,OAAM,IAAI,QAAQ,0BAA0B,yCAAyC;AAEzF,QAAK,EAAE,aAAa,WAAW,KAAK,SAAS;AAC7C,QAAK,EAAE,aAAa,gBAAgB,KAAK,KAAK,EAAE,aAAa;AAC7D,QAAK,EAAE,eAAe,KAAK,EAAE,eAAe;AAE5C,OAAI,cAAc,SAAS,UAAU,QAAQ;AACzC,SAAK,EAAE,qBAAqB,KAAK,EAAE;AACnC,SAAK,EAAE,WAAW,YAAY,KAAK;KAC/B,OAAO,KAAK,EAAE,WAAW,YAAY;KACrC,KAAK,SAAS;KACjB,CAAC;cAEG,cAAc,SAAS,UAAU,OACtC,MAAK,EAAE,qBAAqB,KAAK,EAAE;YAE9B,cAAc,SAAS,UAAU,OACtC,MAAK,EAAE,qBAAqB,KAAK,EAAE;AAGvC,QAAK,EAAE,aAAa,QAAQ;AAC5B,QAAK,EAAE,aAAa,aAAa,aAAa;AAC9C,UAAO;;;AAGf,SAAQ,yBAAyB"}
|
|
@@ -1,368 +0,0 @@
|
|
|
1
|
-
import { __commonJSMin } from "../../../../../../_virtual/rolldown_runtime.mjs";
|
|
2
|
-
import { require_error } from "./error.mjs";
|
|
3
|
-
import { require_constants } from "./constants.mjs";
|
|
4
|
-
import { require_utils } from "./utils.mjs";
|
|
5
|
-
import { require_timeout } from "./timeout.mjs";
|
|
6
|
-
import { require_mongo_types } from "./mongo_types.mjs";
|
|
7
|
-
import { require_db } from "./db.mjs";
|
|
8
|
-
import { require_mongo_client } from "./mongo_client.mjs";
|
|
9
|
-
import { require_resource_management } from "./resource_management.mjs";
|
|
10
|
-
import { require_abstract_cursor } from "./cursor/abstract_cursor.mjs";
|
|
11
|
-
import { require_collection } from "./collection.mjs";
|
|
12
|
-
import { require_change_stream_cursor } from "./cursor/change_stream_cursor.mjs";
|
|
13
|
-
|
|
14
|
-
//#region ../../node_modules/.pnpm/mongodb@6.21.0/node_modules/mongodb/lib/change_stream.js
|
|
15
|
-
var require_change_stream = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ChangeStream = void 0;
|
|
18
|
-
const collection_1 = require_collection();
|
|
19
|
-
const constants_1 = require_constants();
|
|
20
|
-
const abstract_cursor_1 = require_abstract_cursor();
|
|
21
|
-
const change_stream_cursor_1 = require_change_stream_cursor();
|
|
22
|
-
const db_1 = require_db();
|
|
23
|
-
const error_1 = require_error();
|
|
24
|
-
const mongo_client_1 = require_mongo_client();
|
|
25
|
-
const mongo_types_1 = require_mongo_types();
|
|
26
|
-
const resource_management_1 = require_resource_management();
|
|
27
|
-
const timeout_1 = require_timeout();
|
|
28
|
-
const utils_1 = require_utils();
|
|
29
|
-
const CHANGE_STREAM_OPTIONS = [
|
|
30
|
-
"resumeAfter",
|
|
31
|
-
"startAfter",
|
|
32
|
-
"startAtOperationTime",
|
|
33
|
-
"fullDocument",
|
|
34
|
-
"fullDocumentBeforeChange",
|
|
35
|
-
"showExpandedEvents"
|
|
36
|
-
];
|
|
37
|
-
const CHANGE_DOMAIN_TYPES = {
|
|
38
|
-
COLLECTION: Symbol("Collection"),
|
|
39
|
-
DATABASE: Symbol("Database"),
|
|
40
|
-
CLUSTER: Symbol("Cluster")
|
|
41
|
-
};
|
|
42
|
-
const CHANGE_STREAM_EVENTS = [
|
|
43
|
-
constants_1.RESUME_TOKEN_CHANGED,
|
|
44
|
-
constants_1.END,
|
|
45
|
-
constants_1.CLOSE
|
|
46
|
-
];
|
|
47
|
-
const NO_RESUME_TOKEN_ERROR = "A change stream document has been received that lacks a resume token (_id).";
|
|
48
|
-
const CHANGESTREAM_CLOSED_ERROR = "ChangeStream is closed";
|
|
49
|
-
/**
|
|
50
|
-
* Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}.
|
|
51
|
-
* @public
|
|
52
|
-
*/
|
|
53
|
-
var ChangeStream = class ChangeStream extends mongo_types_1.TypedEventEmitter {
|
|
54
|
-
/** @internal */
|
|
55
|
-
async asyncDispose() {
|
|
56
|
-
await this.close();
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @internal
|
|
60
|
-
*
|
|
61
|
-
* @param parent - The parent object that created this change stream
|
|
62
|
-
* @param pipeline - An array of {@link https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents
|
|
63
|
-
*/
|
|
64
|
-
constructor(parent, pipeline = [], options = {}) {
|
|
65
|
-
super();
|
|
66
|
-
this.pipeline = pipeline;
|
|
67
|
-
this.options = { ...options };
|
|
68
|
-
let serverSelectionTimeoutMS;
|
|
69
|
-
delete this.options.writeConcern;
|
|
70
|
-
if (parent instanceof collection_1.Collection) {
|
|
71
|
-
this.type = CHANGE_DOMAIN_TYPES.COLLECTION;
|
|
72
|
-
serverSelectionTimeoutMS = parent.s.db.client.options.serverSelectionTimeoutMS;
|
|
73
|
-
} else if (parent instanceof db_1.Db) {
|
|
74
|
-
this.type = CHANGE_DOMAIN_TYPES.DATABASE;
|
|
75
|
-
serverSelectionTimeoutMS = parent.client.options.serverSelectionTimeoutMS;
|
|
76
|
-
} else if (parent instanceof mongo_client_1.MongoClient) {
|
|
77
|
-
this.type = CHANGE_DOMAIN_TYPES.CLUSTER;
|
|
78
|
-
serverSelectionTimeoutMS = parent.options.serverSelectionTimeoutMS;
|
|
79
|
-
} else throw new error_1.MongoChangeStreamError("Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient");
|
|
80
|
-
this.contextOwner = Symbol();
|
|
81
|
-
this.parent = parent;
|
|
82
|
-
this.namespace = parent.s.namespace;
|
|
83
|
-
if (!this.options.readPreference && parent.readPreference) this.options.readPreference = parent.readPreference;
|
|
84
|
-
this.cursor = this._createChangeStreamCursor(options);
|
|
85
|
-
this.isClosed = false;
|
|
86
|
-
this.mode = false;
|
|
87
|
-
this.on("newListener", (eventName) => {
|
|
88
|
-
if (eventName === "change" && this.cursor && this.listenerCount("change") === 0) this._streamEvents(this.cursor);
|
|
89
|
-
});
|
|
90
|
-
this.on("removeListener", (eventName) => {
|
|
91
|
-
if (eventName === "change" && this.listenerCount("change") === 0 && this.cursor) this.cursorStream?.removeAllListeners("data");
|
|
92
|
-
});
|
|
93
|
-
if (this.options.timeoutMS != null) this.timeoutContext = new timeout_1.CSOTTimeoutContext({
|
|
94
|
-
timeoutMS: this.options.timeoutMS,
|
|
95
|
-
serverSelectionTimeoutMS
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/** The cached resume token that is used to resume after the most recently returned change. */
|
|
99
|
-
get resumeToken() {
|
|
100
|
-
return this.cursor?.resumeToken;
|
|
101
|
-
}
|
|
102
|
-
/** Check if there is any document still available in the Change Stream */
|
|
103
|
-
async hasNext() {
|
|
104
|
-
this._setIsIterator();
|
|
105
|
-
this.timeoutContext?.refresh();
|
|
106
|
-
try {
|
|
107
|
-
while (true) try {
|
|
108
|
-
return await this.cursor.hasNext();
|
|
109
|
-
} catch (error) {
|
|
110
|
-
try {
|
|
111
|
-
await this._processErrorIteratorMode(error, this.cursor.id != null);
|
|
112
|
-
} catch (error$1) {
|
|
113
|
-
if (error$1 instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) throw error$1;
|
|
114
|
-
try {
|
|
115
|
-
await this.close();
|
|
116
|
-
} catch (error$2) {
|
|
117
|
-
(0, utils_1.squashError)(error$2);
|
|
118
|
-
}
|
|
119
|
-
throw error$1;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
} finally {
|
|
123
|
-
this.timeoutContext?.clear();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
/** Get the next available document from the Change Stream. */
|
|
127
|
-
async next() {
|
|
128
|
-
this._setIsIterator();
|
|
129
|
-
this.timeoutContext?.refresh();
|
|
130
|
-
try {
|
|
131
|
-
while (true) try {
|
|
132
|
-
const change = await this.cursor.next();
|
|
133
|
-
return this._processChange(change ?? null);
|
|
134
|
-
} catch (error) {
|
|
135
|
-
try {
|
|
136
|
-
await this._processErrorIteratorMode(error, this.cursor.id != null);
|
|
137
|
-
} catch (error$1) {
|
|
138
|
-
if (error$1 instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) throw error$1;
|
|
139
|
-
try {
|
|
140
|
-
await this.close();
|
|
141
|
-
} catch (error$2) {
|
|
142
|
-
(0, utils_1.squashError)(error$2);
|
|
143
|
-
}
|
|
144
|
-
throw error$1;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
} finally {
|
|
148
|
-
this.timeoutContext?.clear();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned
|
|
153
|
-
*/
|
|
154
|
-
async tryNext() {
|
|
155
|
-
this._setIsIterator();
|
|
156
|
-
this.timeoutContext?.refresh();
|
|
157
|
-
try {
|
|
158
|
-
while (true) try {
|
|
159
|
-
const change = await this.cursor.tryNext();
|
|
160
|
-
if (!change) return null;
|
|
161
|
-
return this._processChange(change);
|
|
162
|
-
} catch (error) {
|
|
163
|
-
try {
|
|
164
|
-
await this._processErrorIteratorMode(error, this.cursor.id != null);
|
|
165
|
-
} catch (error$1) {
|
|
166
|
-
if (error$1 instanceof error_1.MongoOperationTimeoutError && this.cursor.id == null) throw error$1;
|
|
167
|
-
try {
|
|
168
|
-
await this.close();
|
|
169
|
-
} catch (error$2) {
|
|
170
|
-
(0, utils_1.squashError)(error$2);
|
|
171
|
-
}
|
|
172
|
-
throw error$1;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
} finally {
|
|
176
|
-
this.timeoutContext?.clear();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
async *[Symbol.asyncIterator]() {
|
|
180
|
-
if (this.closed) return;
|
|
181
|
-
try {
|
|
182
|
-
while (true) yield await this.next();
|
|
183
|
-
} finally {
|
|
184
|
-
try {
|
|
185
|
-
await this.close();
|
|
186
|
-
} catch (error) {
|
|
187
|
-
(0, utils_1.squashError)(error);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
/** Is the cursor closed */
|
|
192
|
-
get closed() {
|
|
193
|
-
return this.isClosed || this.cursor.closed;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Frees the internal resources used by the change stream.
|
|
197
|
-
*/
|
|
198
|
-
async close() {
|
|
199
|
-
this.timeoutContext?.clear();
|
|
200
|
-
this.timeoutContext = void 0;
|
|
201
|
-
this.isClosed = true;
|
|
202
|
-
const cursor = this.cursor;
|
|
203
|
-
try {
|
|
204
|
-
await cursor.close();
|
|
205
|
-
} finally {
|
|
206
|
-
this._endStream();
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Return a modified Readable stream including a possible transform method.
|
|
211
|
-
*
|
|
212
|
-
* NOTE: When using a Stream to process change stream events, the stream will
|
|
213
|
-
* NOT automatically resume in the case a resumable error is encountered.
|
|
214
|
-
*
|
|
215
|
-
* @throws MongoChangeStreamError if the underlying cursor or the change stream is closed
|
|
216
|
-
*/
|
|
217
|
-
stream(options) {
|
|
218
|
-
if (this.closed) throw new error_1.MongoChangeStreamError(CHANGESTREAM_CLOSED_ERROR);
|
|
219
|
-
this.streamOptions = options;
|
|
220
|
-
return this.cursor.stream(options);
|
|
221
|
-
}
|
|
222
|
-
/** @internal */
|
|
223
|
-
_setIsEmitter() {
|
|
224
|
-
if (this.mode === "iterator") throw new error_1.MongoAPIError("ChangeStream cannot be used as an EventEmitter after being used as an iterator");
|
|
225
|
-
this.mode = "emitter";
|
|
226
|
-
}
|
|
227
|
-
/** @internal */
|
|
228
|
-
_setIsIterator() {
|
|
229
|
-
if (this.mode === "emitter") throw new error_1.MongoAPIError("ChangeStream cannot be used as an iterator after being used as an EventEmitter");
|
|
230
|
-
this.mode = "iterator";
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Create a new change stream cursor based on self's configuration
|
|
234
|
-
* @internal
|
|
235
|
-
*/
|
|
236
|
-
_createChangeStreamCursor(options) {
|
|
237
|
-
const changeStreamStageOptions = (0, utils_1.filterOptions)(options, CHANGE_STREAM_OPTIONS);
|
|
238
|
-
if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) changeStreamStageOptions.allChangesForCluster = true;
|
|
239
|
-
const pipeline = [{ $changeStream: changeStreamStageOptions }, ...this.pipeline];
|
|
240
|
-
const client = this.type === CHANGE_DOMAIN_TYPES.CLUSTER ? this.parent : this.type === CHANGE_DOMAIN_TYPES.DATABASE ? this.parent.client : this.type === CHANGE_DOMAIN_TYPES.COLLECTION ? this.parent.client : null;
|
|
241
|
-
if (client == null) throw new error_1.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`);
|
|
242
|
-
const changeStreamCursor = new change_stream_cursor_1.ChangeStreamCursor(client, this.namespace, pipeline, {
|
|
243
|
-
...options,
|
|
244
|
-
timeoutContext: this.timeoutContext ? new abstract_cursor_1.CursorTimeoutContext(this.timeoutContext, this.contextOwner) : void 0
|
|
245
|
-
});
|
|
246
|
-
for (const event of CHANGE_STREAM_EVENTS) changeStreamCursor.on(event, (e) => this.emit(event, e));
|
|
247
|
-
if (this.listenerCount(ChangeStream.CHANGE) > 0) this._streamEvents(changeStreamCursor);
|
|
248
|
-
return changeStreamCursor;
|
|
249
|
-
}
|
|
250
|
-
/** @internal */
|
|
251
|
-
_closeEmitterModeWithError(error) {
|
|
252
|
-
this.emit(ChangeStream.ERROR, error);
|
|
253
|
-
this.close().then(void 0, utils_1.squashError);
|
|
254
|
-
}
|
|
255
|
-
/** @internal */
|
|
256
|
-
_streamEvents(cursor) {
|
|
257
|
-
this._setIsEmitter();
|
|
258
|
-
const stream = this.cursorStream ?? cursor.stream();
|
|
259
|
-
this.cursorStream = stream;
|
|
260
|
-
stream.on("data", (change) => {
|
|
261
|
-
try {
|
|
262
|
-
const processedChange = this._processChange(change);
|
|
263
|
-
this.emit(ChangeStream.CHANGE, processedChange);
|
|
264
|
-
} catch (error) {
|
|
265
|
-
this.emit(ChangeStream.ERROR, error);
|
|
266
|
-
}
|
|
267
|
-
this.timeoutContext?.refresh();
|
|
268
|
-
});
|
|
269
|
-
stream.on("error", (error) => this._processErrorStreamMode(error, this.cursor.id != null));
|
|
270
|
-
}
|
|
271
|
-
/** @internal */
|
|
272
|
-
_endStream() {
|
|
273
|
-
this.cursorStream?.removeAllListeners("data");
|
|
274
|
-
this.cursorStream?.removeAllListeners("close");
|
|
275
|
-
this.cursorStream?.removeAllListeners("end");
|
|
276
|
-
this.cursorStream?.destroy();
|
|
277
|
-
this.cursorStream = void 0;
|
|
278
|
-
}
|
|
279
|
-
/** @internal */
|
|
280
|
-
_processChange(change) {
|
|
281
|
-
if (this.isClosed) throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR);
|
|
282
|
-
if (change == null) throw new error_1.MongoRuntimeError(CHANGESTREAM_CLOSED_ERROR);
|
|
283
|
-
if (change && !change._id) throw new error_1.MongoChangeStreamError(NO_RESUME_TOKEN_ERROR);
|
|
284
|
-
this.cursor.cacheResumeToken(change._id);
|
|
285
|
-
this.options.startAtOperationTime = void 0;
|
|
286
|
-
return change;
|
|
287
|
-
}
|
|
288
|
-
/** @internal */
|
|
289
|
-
_processErrorStreamMode(changeStreamError, cursorInitialized) {
|
|
290
|
-
if (this.isClosed) return;
|
|
291
|
-
if (cursorInitialized && ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) || changeStreamError instanceof error_1.MongoOperationTimeoutError)) {
|
|
292
|
-
this._endStream();
|
|
293
|
-
this.cursor.close().then(() => this._resume(changeStreamError), (e) => {
|
|
294
|
-
(0, utils_1.squashError)(e);
|
|
295
|
-
return this._resume(changeStreamError);
|
|
296
|
-
}).then(() => {
|
|
297
|
-
if (changeStreamError instanceof error_1.MongoOperationTimeoutError) this.emit(ChangeStream.ERROR, changeStreamError);
|
|
298
|
-
}, () => this._closeEmitterModeWithError(changeStreamError));
|
|
299
|
-
} else this._closeEmitterModeWithError(changeStreamError);
|
|
300
|
-
}
|
|
301
|
-
/** @internal */
|
|
302
|
-
async _processErrorIteratorMode(changeStreamError, cursorInitialized) {
|
|
303
|
-
if (this.isClosed) throw new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR);
|
|
304
|
-
if (cursorInitialized && ((0, error_1.isResumableError)(changeStreamError, this.cursor.maxWireVersion) || changeStreamError instanceof error_1.MongoOperationTimeoutError)) {
|
|
305
|
-
try {
|
|
306
|
-
await this.cursor.close();
|
|
307
|
-
} catch (error) {
|
|
308
|
-
(0, utils_1.squashError)(error);
|
|
309
|
-
}
|
|
310
|
-
await this._resume(changeStreamError);
|
|
311
|
-
if (changeStreamError instanceof error_1.MongoOperationTimeoutError) throw changeStreamError;
|
|
312
|
-
} else {
|
|
313
|
-
try {
|
|
314
|
-
await this.close();
|
|
315
|
-
} catch (error) {
|
|
316
|
-
(0, utils_1.squashError)(error);
|
|
317
|
-
}
|
|
318
|
-
throw changeStreamError;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
async _resume(changeStreamError) {
|
|
322
|
-
this.timeoutContext?.refresh();
|
|
323
|
-
const topology = (0, utils_1.getTopology)(this.parent);
|
|
324
|
-
try {
|
|
325
|
-
await topology.selectServer(this.cursor.readPreference, {
|
|
326
|
-
operationName: "reconnect topology in change stream",
|
|
327
|
-
timeoutContext: this.timeoutContext
|
|
328
|
-
});
|
|
329
|
-
this.cursor = this._createChangeStreamCursor(this.cursor.resumeOptions);
|
|
330
|
-
} catch {
|
|
331
|
-
await this.close();
|
|
332
|
-
throw changeStreamError;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
exports.ChangeStream = ChangeStream;
|
|
337
|
-
/** @event */
|
|
338
|
-
ChangeStream.RESPONSE = constants_1.RESPONSE;
|
|
339
|
-
/** @event */
|
|
340
|
-
ChangeStream.MORE = constants_1.MORE;
|
|
341
|
-
/** @event */
|
|
342
|
-
ChangeStream.INIT = constants_1.INIT;
|
|
343
|
-
/** @event */
|
|
344
|
-
ChangeStream.CLOSE = constants_1.CLOSE;
|
|
345
|
-
/**
|
|
346
|
-
* Fired for each new matching change in the specified namespace. Attaching a `change`
|
|
347
|
-
* event listener to a Change Stream will switch the stream into flowing mode. Data will
|
|
348
|
-
* then be passed as soon as it is available.
|
|
349
|
-
* @event
|
|
350
|
-
*/
|
|
351
|
-
ChangeStream.CHANGE = constants_1.CHANGE;
|
|
352
|
-
/** @event */
|
|
353
|
-
ChangeStream.END = constants_1.END;
|
|
354
|
-
/** @event */
|
|
355
|
-
ChangeStream.ERROR = constants_1.ERROR;
|
|
356
|
-
/**
|
|
357
|
-
* Emitted each time the change stream stores a new resume token.
|
|
358
|
-
* @event
|
|
359
|
-
*/
|
|
360
|
-
ChangeStream.RESUME_TOKEN_CHANGED = constants_1.RESUME_TOKEN_CHANGED;
|
|
361
|
-
(0, resource_management_1.configureResourceManagement)(ChangeStream.prototype);
|
|
362
|
-
}));
|
|
363
|
-
|
|
364
|
-
//#endregion
|
|
365
|
-
export default require_change_stream();
|
|
366
|
-
|
|
367
|
-
export { require_change_stream };
|
|
368
|
-
//# sourceMappingURL=change_stream.mjs.map
|