@colyseus/core 0.14.21 → 0.14.25
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/build/Logger.d.ts +9 -0
- package/build/Logger.js +12 -0
- package/build/Logger.js.map +1 -0
- package/build/Logger.mjs +8 -0
- package/build/Logger.mjs.map +1 -0
- package/build/Room.js +2 -0
- package/build/Room.js.map +1 -1
- package/build/Room.mjs +2 -0
- package/build/Room.mjs.map +1 -1
- package/build/Server.js +1 -1
- package/build/Server.js.map +1 -1
- package/build/Server.mjs +1 -1
- package/build/Server.mjs.map +1 -1
- package/build/_virtual/AggregationCursor.js_commonjs-proxy +3 -0
- package/build/_virtual/AggregationCursor.js_commonjs-proxy.map +1 -0
- package/build/_virtual/BufferList.js_commonjs-proxy +3 -0
- package/build/_virtual/BufferList.js_commonjs-proxy.map +1 -0
- package/build/_virtual/ChangeStream.js_commonjs-proxy +3 -0
- package/build/_virtual/ChangeStream.js_commonjs-proxy.map +1 -0
- package/build/_virtual/PopulateOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/PopulateOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/QueryCursor.js_commonjs-proxy +3 -0
- package/build/_virtual/QueryCursor.js_commonjs-proxy.map +1 -0
- package/build/_virtual/ReadPreference.js_commonjs-proxy +3 -0
- package/build/_virtual/ReadPreference.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaArrayOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaArrayOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaBufferOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaBufferOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaDateOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaDateOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaDocumentArrayOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaDocumentArrayOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaMapOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaMapOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaNumberOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaNumberOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaObjectIdOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaObjectIdOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaSingleNestedOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaSingleNestedOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaStringOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaStringOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SchemaTypeOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/SchemaTypeOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SingleNestedPath.js_commonjs-proxy +3 -0
- package/build/_virtual/SingleNestedPath.js_commonjs-proxy.map +1 -0
- package/build/_virtual/SkipPopulateValue.js_commonjs-proxy +3 -0
- package/build/_virtual/SkipPopulateValue.js_commonjs-proxy.map +1 -0
- package/build/_virtual/VirtualOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/VirtualOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/_commonjsHelpers.js +28 -0
- package/build/_virtual/_commonjsHelpers.js.map +1 -0
- package/build/_virtual/_stream_duplex.js_commonjs-proxy +3 -0
- package/build/_virtual/_stream_duplex.js_commonjs-proxy.map +1 -0
- package/build/_virtual/_stream_passthrough.js_commonjs-proxy +3 -0
- package/build/_virtual/_stream_passthrough.js_commonjs-proxy.map +1 -0
- package/build/_virtual/_stream_readable.js_commonjs-proxy +3 -0
- package/build/_virtual/_stream_readable.js_commonjs-proxy.map +1 -0
- package/build/_virtual/_stream_transform.js_commonjs-proxy +3 -0
- package/build/_virtual/_stream_transform.js_commonjs-proxy.map +1 -0
- package/build/_virtual/_stream_writable.js_commonjs-proxy +3 -0
- package/build/_virtual/_stream_writable.js_commonjs-proxy.map +1 -0
- package/build/_virtual/addAutoId.js_commonjs-proxy +3 -0
- package/build/_virtual/addAutoId.js_commonjs-proxy.map +1 -0
- package/build/_virtual/add_user.js_commonjs-proxy +3 -0
- package/build/_virtual/add_user.js_commonjs-proxy.map +1 -0
- package/build/_virtual/admin.js_commonjs-proxy +3 -0
- package/build/_virtual/admin.js_commonjs-proxy.map +1 -0
- package/build/_virtual/aggregate.js_commonjs-proxy +3 -0
- package/build/_virtual/aggregate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/aggregate2.js_commonjs-proxy +3 -0
- package/build/_virtual/aggregate2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/aggregation_cursor.js_commonjs-proxy +3 -0
- package/build/_virtual/aggregation_cursor.js_commonjs-proxy.map +1 -0
- package/build/_virtual/allServersUnknown.js_commonjs-proxy +3 -0
- package/build/_virtual/allServersUnknown.js_commonjs-proxy.map +1 -0
- package/build/_virtual/any.js_commonjs-proxy +3 -0
- package/build/_virtual/any.js_commonjs-proxy.map +1 -0
- package/build/_virtual/apm.js_commonjs-proxy +3 -0
- package/build/_virtual/apm.js_commonjs-proxy.map +1 -0
- package/build/_virtual/apm2.js_commonjs-proxy +3 -0
- package/build/_virtual/apm2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyGlobalMaxTimeMS.js_commonjs-proxy +3 -0
- package/build/_virtual/applyGlobalMaxTimeMS.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyHooks.js_commonjs-proxy +3 -0
- package/build/_virtual/applyHooks.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyMethods.js_commonjs-proxy +3 -0
- package/build/_virtual/applyMethods.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyPlugins.js_commonjs-proxy +3 -0
- package/build/_virtual/applyPlugins.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyQueryMiddleware.js_commonjs-proxy +3 -0
- package/build/_virtual/applyQueryMiddleware.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyStaticHooks.js_commonjs-proxy +3 -0
- package/build/_virtual/applyStaticHooks.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyStatics.js_commonjs-proxy +3 -0
- package/build/_virtual/applyStatics.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyTimestampsToChildren.js_commonjs-proxy +3 -0
- package/build/_virtual/applyTimestampsToChildren.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyTimestampsToUpdate.js_commonjs-proxy +3 -0
- package/build/_virtual/applyTimestampsToUpdate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/applyWriteConcern.js_commonjs-proxy +3 -0
- package/build/_virtual/applyWriteConcern.js_commonjs-proxy.map +1 -0
- package/build/_virtual/areDiscriminatorValuesEqual.js_commonjs-proxy +3 -0
- package/build/_virtual/areDiscriminatorValuesEqual.js_commonjs-proxy.map +1 -0
- package/build/_virtual/array.js_commonjs-proxy +3 -0
- package/build/_virtual/array.js_commonjs-proxy.map +1 -0
- package/build/_virtual/array2.js_commonjs-proxy +3 -0
- package/build/_virtual/array2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/arrayDepth.js_commonjs-proxy +3 -0
- package/build/_virtual/arrayDepth.js_commonjs-proxy.map +1 -0
- package/build/_virtual/assignRawDocsToIdStructure.js_commonjs-proxy +3 -0
- package/build/_virtual/assignRawDocsToIdStructure.js_commonjs-proxy.map +1 -0
- package/build/_virtual/assignVals.js_commonjs-proxy +3 -0
- package/build/_virtual/assignVals.js_commonjs-proxy.map +1 -0
- package/build/_virtual/async.js_commonjs-proxy +3 -0
- package/build/_virtual/async.js_commonjs-proxy.map +1 -0
- package/build/_virtual/async_iterator.js_commonjs-proxy +3 -0
- package/build/_virtual/async_iterator.js_commonjs-proxy.map +1 -0
- package/build/_virtual/auth_provider.js_commonjs-proxy +3 -0
- package/build/_virtual/auth_provider.js_commonjs-proxy.map +1 -0
- package/build/_virtual/aws4.js_commonjs-proxy +3 -0
- package/build/_virtual/aws4.js_commonjs-proxy.map +1 -0
- package/build/_virtual/binary.js_commonjs-proxy +3 -0
- package/build/_virtual/binary.js_commonjs-proxy.map +1 -0
- package/build/_virtual/binary2.js_commonjs-proxy +3 -0
- package/build/_virtual/binary2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/bind.js_commonjs-proxy +3 -0
- package/build/_virtual/bind.js_commonjs-proxy.map +1 -0
- package/build/_virtual/bitwise.js_commonjs-proxy +3 -0
- package/build/_virtual/bitwise.js_commonjs-proxy.map +1 -0
- package/build/_virtual/bl.js_commonjs-proxy +3 -0
- package/build/_virtual/bl.js_commonjs-proxy.map +1 -0
- package/build/_virtual/bluebird.js_commonjs-proxy +3 -0
- package/build/_virtual/bluebird.js_commonjs-proxy.map +1 -0
- package/build/_virtual/boolean.js_commonjs-proxy +3 -0
- package/build/_virtual/boolean.js_commonjs-proxy.map +1 -0
- package/build/_virtual/boolean2.js_commonjs-proxy +3 -0
- package/build/_virtual/boolean2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/browserDocument.js_commonjs-proxy +3 -0
- package/build/_virtual/browserDocument.js_commonjs-proxy.map +1 -0
- package/build/_virtual/bson.js_commonjs-proxy +3 -0
- package/build/_virtual/bson.js_commonjs-proxy.map +1 -0
- package/build/_virtual/buffer-util.js_commonjs-proxy +3 -0
- package/build/_virtual/buffer-util.js_commonjs-proxy.map +1 -0
- package/build/_virtual/buffer.js_commonjs-proxy +3 -0
- package/build/_virtual/buffer.js_commonjs-proxy.map +1 -0
- package/build/_virtual/buffer2.js_commonjs-proxy +3 -0
- package/build/_virtual/buffer2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/bulk_write.js_commonjs-proxy +3 -0
- package/build/_virtual/bulk_write.js_commonjs-proxy.map +1 -0
- package/build/_virtual/calculate_size.js_commonjs-proxy +3 -0
- package/build/_virtual/calculate_size.js_commonjs-proxy.map +1 -0
- package/build/_virtual/call_get.js_commonjs-proxy +3 -0
- package/build/_virtual/call_get.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cancel.js_commonjs-proxy +3 -0
- package/build/_virtual/cancel.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cast.js_commonjs-proxy +3 -0
- package/build/_virtual/cast.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cast2.js_commonjs-proxy +3 -0
- package/build/_virtual/cast2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/castArrayFilters.js_commonjs-proxy +3 -0
- package/build/_virtual/castArrayFilters.js_commonjs-proxy.map +1 -0
- package/build/_virtual/castBulkWrite.js_commonjs-proxy +3 -0
- package/build/_virtual/castBulkWrite.js_commonjs-proxy.map +1 -0
- package/build/_virtual/castFilterPath.js_commonjs-proxy +3 -0
- package/build/_virtual/castFilterPath.js_commonjs-proxy.map +1 -0
- package/build/_virtual/castUpdate.js_commonjs-proxy +3 -0
- package/build/_virtual/castUpdate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/catch_filter.js_commonjs-proxy +3 -0
- package/build/_virtual/catch_filter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/change_stream.js_commonjs-proxy +3 -0
- package/build/_virtual/change_stream.js_commonjs-proxy.map +1 -0
- package/build/_virtual/checkEmbeddedDiscriminatorKeyProjection.js_commonjs-proxy +3 -0
- package/build/_virtual/checkEmbeddedDiscriminatorKeyProjection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/chunk.js_commonjs-proxy +3 -0
- package/build/_virtual/chunk.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cleanModifiedSubpaths.js_commonjs-proxy +3 -0
- package/build/_virtual/cleanModifiedSubpaths.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cleanPositionalOperators.js_commonjs-proxy +3 -0
- package/build/_virtual/cleanPositionalOperators.js_commonjs-proxy.map +1 -0
- package/build/_virtual/clone.js_commonjs-proxy +3 -0
- package/build/_virtual/clone.js_commonjs-proxy.map +1 -0
- package/build/_virtual/code.js_commonjs-proxy +3 -0
- package/build/_virtual/code.js_commonjs-proxy.map +1 -0
- package/build/_virtual/collection.js_commonjs-proxy +3 -0
- package/build/_virtual/collection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/collection2.js_commonjs-proxy +3 -0
- package/build/_virtual/collection2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/collection3.js_commonjs-proxy +3 -0
- package/build/_virtual/collection3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/collection4.js_commonjs-proxy +3 -0
- package/build/_virtual/collection4.js_commonjs-proxy.map +1 -0
- package/build/_virtual/collection_ops.js_commonjs-proxy +3 -0
- package/build/_virtual/collection_ops.js_commonjs-proxy.map +1 -0
- package/build/_virtual/collections.js_commonjs-proxy +3 -0
- package/build/_virtual/collections.js_commonjs-proxy.map +1 -0
- package/build/_virtual/command.js_commonjs-proxy +3 -0
- package/build/_virtual/command.js_commonjs-proxy.map +1 -0
- package/build/_virtual/command2.js_commonjs-proxy +3 -0
- package/build/_virtual/command2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/command3.js_commonjs-proxy +3 -0
- package/build/_virtual/command3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/command_cursor.js_commonjs-proxy +3 -0
- package/build/_virtual/command_cursor.js_commonjs-proxy.map +1 -0
- package/build/_virtual/command_result.js_commonjs-proxy +3 -0
- package/build/_virtual/command_result.js_commonjs-proxy.map +1 -0
- package/build/_virtual/command_v2.js_commonjs-proxy +3 -0
- package/build/_virtual/command_v2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/commands.js_commonjs-proxy +3 -0
- package/build/_virtual/commands.js_commonjs-proxy.map +1 -0
- package/build/_virtual/commands2.js_commonjs-proxy +3 -0
- package/build/_virtual/commands2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/common.js_commonjs-proxy +3 -0
- package/build/_virtual/common.js_commonjs-proxy.map +1 -0
- package/build/_virtual/common2.js_commonjs-proxy +3 -0
- package/build/_virtual/common2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/common3.js_commonjs-proxy +3 -0
- package/build/_virtual/common3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/common_functions.js_commonjs-proxy +3 -0
- package/build/_virtual/common_functions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/compile.js_commonjs-proxy +3 -0
- package/build/_virtual/compile.js_commonjs-proxy.map +1 -0
- package/build/_virtual/completeMany.js_commonjs-proxy +3 -0
- package/build/_virtual/completeMany.js_commonjs-proxy.map +1 -0
- package/build/_virtual/compression.js_commonjs-proxy +3 -0
- package/build/_virtual/compression.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connect.js_commonjs-proxy +3 -0
- package/build/_virtual/connect.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connect2.js_commonjs-proxy +3 -0
- package/build/_virtual/connect2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connection.js_commonjs-proxy +3 -0
- package/build/_virtual/connection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connection2.js_commonjs-proxy +3 -0
- package/build/_virtual/connection2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connection3.js_commonjs-proxy +3 -0
- package/build/_virtual/connection3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connection4.js_commonjs-proxy +3 -0
- package/build/_virtual/connection4.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connection_pool.js_commonjs-proxy +3 -0
- package/build/_virtual/connection_pool.js_commonjs-proxy.map +1 -0
- package/build/_virtual/connectionstate.js_commonjs-proxy +3 -0
- package/build/_virtual/connectionstate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/constants.js_commonjs-proxy +3 -0
- package/build/_virtual/constants.js_commonjs-proxy.map +1 -0
- package/build/_virtual/constants2.js_commonjs-proxy +3 -0
- package/build/_virtual/constants2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/constants3.js_commonjs-proxy +3 -0
- package/build/_virtual/constants3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/context.js_commonjs-proxy +3 -0
- package/build/_virtual/context.js_commonjs-proxy.map +1 -0
- package/build/_virtual/core_array.js_commonjs-proxy +3 -0
- package/build/_virtual/core_array.js_commonjs-proxy.map +1 -0
- package/build/_virtual/count.js_commonjs-proxy +3 -0
- package/build/_virtual/count.js_commonjs-proxy.map +1 -0
- package/build/_virtual/count_documents.js_commonjs-proxy +3 -0
- package/build/_virtual/count_documents.js_commonjs-proxy.map +1 -0
- package/build/_virtual/createClient.js_commonjs-proxy +3 -0
- package/build/_virtual/createClient.js_commonjs-proxy.map +1 -0
- package/build/_virtual/createPopulateQueryFilter.js_commonjs-proxy +3 -0
- package/build/_virtual/createPopulateQueryFilter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/create_collection.js_commonjs-proxy +3 -0
- package/build/_virtual/create_collection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/create_indexes.js_commonjs-proxy +3 -0
- package/build/_virtual/create_indexes.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cursor.js_commonjs-proxy +3 -0
- package/build/_virtual/cursor.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cursor2.js_commonjs-proxy +3 -0
- package/build/_virtual/cursor2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/cursor_ops.js_commonjs-proxy +3 -0
- package/build/_virtual/cursor_ops.js_commonjs-proxy.map +1 -0
- package/build/_virtual/customErrors.js_commonjs-proxy +3 -0
- package/build/_virtual/customErrors.js_commonjs-proxy.map +1 -0
- package/build/_virtual/date.js_commonjs-proxy +3 -0
- package/build/_virtual/date.js_commonjs-proxy.map +1 -0
- package/build/_virtual/date2.js_commonjs-proxy +3 -0
- package/build/_virtual/date2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/db.js_commonjs-proxy +3 -0
- package/build/_virtual/db.js_commonjs-proxy.map +1 -0
- package/build/_virtual/db_ops.js_commonjs-proxy +3 -0
- package/build/_virtual/db_ops.js_commonjs-proxy.map +1 -0
- package/build/_virtual/db_ref.js_commonjs-proxy +3 -0
- package/build/_virtual/db_ref.js_commonjs-proxy.map +1 -0
- package/build/_virtual/debug.js_commonjs-proxy +3 -0
- package/build/_virtual/debug.js_commonjs-proxy.map +1 -0
- package/build/_virtual/debuggability.js_commonjs-proxy +3 -0
- package/build/_virtual/debuggability.js_commonjs-proxy.map +1 -0
- package/build/_virtual/decimal128.js_commonjs-proxy +3 -0
- package/build/_virtual/decimal128.js_commonjs-proxy.map +1 -0
- package/build/_virtual/decimal1282.js_commonjs-proxy +3 -0
- package/build/_virtual/decimal1282.js_commonjs-proxy.map +1 -0
- package/build/_virtual/decimal1283.js_commonjs-proxy +3 -0
- package/build/_virtual/decimal1283.js_commonjs-proxy.map +1 -0
- package/build/_virtual/decimal1284.js_commonjs-proxy +3 -0
- package/build/_virtual/decimal1284.js_commonjs-proxy.map +1 -0
- package/build/_virtual/decimal1285.js_commonjs-proxy +3 -0
- package/build/_virtual/decimal1285.js_commonjs-proxy.map +1 -0
- package/build/_virtual/defaultAuthProviders.js_commonjs-proxy +3 -0
- package/build/_virtual/defaultAuthProviders.js_commonjs-proxy.map +1 -0
- package/build/_virtual/delete_many.js_commonjs-proxy +3 -0
- package/build/_virtual/delete_many.js_commonjs-proxy.map +1 -0
- package/build/_virtual/delete_one.js_commonjs-proxy +3 -0
- package/build/_virtual/delete_one.js_commonjs-proxy.map +1 -0
- package/build/_virtual/deque.js_commonjs-proxy +3 -0
- package/build/_virtual/deque.js_commonjs-proxy.map +1 -0
- package/build/_virtual/deserializer.js_commonjs-proxy +3 -0
- package/build/_virtual/deserializer.js_commonjs-proxy.map +1 -0
- package/build/_virtual/destroy.js_commonjs-proxy +3 -0
- package/build/_virtual/destroy.js_commonjs-proxy.map +1 -0
- package/build/_virtual/direct_resolve.js_commonjs-proxy +3 -0
- package/build/_virtual/direct_resolve.js_commonjs-proxy.map +1 -0
- package/build/_virtual/discriminator.js_commonjs-proxy +3 -0
- package/build/_virtual/discriminator.js_commonjs-proxy.map +1 -0
- package/build/_virtual/distinct.js_commonjs-proxy +3 -0
- package/build/_virtual/distinct.js_commonjs-proxy.map +1 -0
- package/build/_virtual/divergentArray.js_commonjs-proxy +3 -0
- package/build/_virtual/divergentArray.js_commonjs-proxy.map +1 -0
- package/build/_virtual/document.js_commonjs-proxy +3 -0
- package/build/_virtual/document.js_commonjs-proxy.map +1 -0
- package/build/_virtual/document_provider.js_commonjs-proxy +3 -0
- package/build/_virtual/document_provider.js_commonjs-proxy.map +1 -0
- package/build/_virtual/documentarray.js_commonjs-proxy +3 -0
- package/build/_virtual/documentarray.js_commonjs-proxy.map +1 -0
- package/build/_virtual/documentarray2.js_commonjs-proxy +3 -0
- package/build/_virtual/documentarray2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/double.js_commonjs-proxy +3 -0
- package/build/_virtual/double.js_commonjs-proxy.map +1 -0
- package/build/_virtual/download.js_commonjs-proxy +3 -0
- package/build/_virtual/download.js_commonjs-proxy.map +1 -0
- package/build/_virtual/driver.js_commonjs-proxy +3 -0
- package/build/_virtual/driver.js_commonjs-proxy.map +1 -0
- package/build/_virtual/drop.js_commonjs-proxy +3 -0
- package/build/_virtual/drop.js_commonjs-proxy.map +1 -0
- package/build/_virtual/drop_index.js_commonjs-proxy +3 -0
- package/build/_virtual/drop_index.js_commonjs-proxy.map +1 -0
- package/build/_virtual/drop_indexes.js_commonjs-proxy +3 -0
- package/build/_virtual/drop_indexes.js_commonjs-proxy.map +1 -0
- package/build/_virtual/dynamic_loaders.js_commonjs-proxy +3 -0
- package/build/_virtual/dynamic_loaders.js_commonjs-proxy.map +1 -0
- package/build/_virtual/each.js_commonjs-proxy +3 -0
- package/build/_virtual/each.js_commonjs-proxy.map +1 -0
- package/build/_virtual/each2.js_commonjs-proxy +3 -0
- package/build/_virtual/each2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/eachAsync.js_commonjs-proxy +3 -0
- package/build/_virtual/eachAsync.js_commonjs-proxy.map +1 -0
- package/build/_virtual/embedded.js_commonjs-proxy +3 -0
- package/build/_virtual/embedded.js_commonjs-proxy.map +1 -0
- package/build/_virtual/encrypter.js_commonjs-proxy +3 -0
- package/build/_virtual/encrypter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/env.js_commonjs-proxy +3 -0
- package/build/_virtual/env.js_commonjs-proxy.map +1 -0
- package/build/_virtual/error.js_commonjs-proxy +3 -0
- package/build/_virtual/error.js_commonjs-proxy.map +1 -0
- package/build/_virtual/error2.js_commonjs-proxy +3 -0
- package/build/_virtual/error2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/errors.js_commonjs-proxy +3 -0
- package/build/_virtual/errors.js_commonjs-proxy.map +1 -0
- package/build/_virtual/errors2.js_commonjs-proxy +3 -0
- package/build/_virtual/errors2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/es5.js_commonjs-proxy +3 -0
- package/build/_virtual/es5.js_commonjs-proxy.map +1 -0
- package/build/_virtual/estimated_document_count.js_commonjs-proxy +3 -0
- package/build/_virtual/estimated_document_count.js_commonjs-proxy.map +1 -0
- package/build/_virtual/event-target.js_commonjs-proxy +3 -0
- package/build/_virtual/event-target.js_commonjs-proxy.map +1 -0
- package/build/_virtual/events.js_commonjs-proxy +3 -0
- package/build/_virtual/events.js_commonjs-proxy.map +1 -0
- package/build/_virtual/events2.js_commonjs-proxy +3 -0
- package/build/_virtual/events2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/execute_db_admin_command.js_commonjs-proxy +3 -0
- package/build/_virtual/execute_db_admin_command.js_commonjs-proxy.map +1 -0
- package/build/_virtual/execute_operation.js_commonjs-proxy +3 -0
- package/build/_virtual/execute_operation.js_commonjs-proxy.map +1 -0
- package/build/_virtual/exists.js_commonjs-proxy +3 -0
- package/build/_virtual/exists.js_commonjs-proxy.map +1 -0
- package/build/_virtual/explain.js_commonjs-proxy +3 -0
- package/build/_virtual/explain.js_commonjs-proxy.map +1 -0
- package/build/_virtual/extension.js_commonjs-proxy +3 -0
- package/build/_virtual/extension.js_commonjs-proxy.map +1 -0
- package/build/_virtual/filter.js_commonjs-proxy +3 -0
- package/build/_virtual/filter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/finally.js_commonjs-proxy +3 -0
- package/build/_virtual/finally.js_commonjs-proxy.map +1 -0
- package/build/_virtual/find.js_commonjs-proxy +3 -0
- package/build/_virtual/find.js_commonjs-proxy.map +1 -0
- package/build/_virtual/find_and_modify.js_commonjs-proxy +3 -0
- package/build/_virtual/find_and_modify.js_commonjs-proxy.map +1 -0
- package/build/_virtual/find_one.js_commonjs-proxy +3 -0
- package/build/_virtual/find_one.js_commonjs-proxy.map +1 -0
- package/build/_virtual/find_one_and_delete.js_commonjs-proxy +3 -0
- package/build/_virtual/find_one_and_delete.js_commonjs-proxy.map +1 -0
- package/build/_virtual/find_one_and_replace.js_commonjs-proxy +3 -0
- package/build/_virtual/find_one_and_replace.js_commonjs-proxy.map +1 -0
- package/build/_virtual/find_one_and_update.js_commonjs-proxy +3 -0
- package/build/_virtual/find_one_and_update.js_commonjs-proxy.map +1 -0
- package/build/_virtual/float_parser.js_commonjs-proxy +3 -0
- package/build/_virtual/float_parser.js_commonjs-proxy.map +1 -0
- package/build/_virtual/generators.js_commonjs-proxy +3 -0
- package/build/_virtual/generators.js_commonjs-proxy.map +1 -0
- package/build/_virtual/geo_haystack_search.js_commonjs-proxy +3 -0
- package/build/_virtual/geo_haystack_search.js_commonjs-proxy.map +1 -0
- package/build/_virtual/geospatial.js_commonjs-proxy +3 -0
- package/build/_virtual/geospatial.js_commonjs-proxy.map +1 -0
- package/build/_virtual/get.js_commonjs-proxy +3 -0
- package/build/_virtual/get.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getConstructor.js_commonjs-proxy +3 -0
- package/build/_virtual/getConstructor.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getDefaultBulkwriteResult.js_commonjs-proxy +3 -0
- package/build/_virtual/getDefaultBulkwriteResult.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getDiscriminatorByValue.js_commonjs-proxy +3 -0
- package/build/_virtual/getDiscriminatorByValue.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getEmbeddedDiscriminatorPath.js_commonjs-proxy +3 -0
- package/build/_virtual/getEmbeddedDiscriminatorPath.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getEmbeddedDiscriminatorPath2.js_commonjs-proxy +3 -0
- package/build/_virtual/getEmbeddedDiscriminatorPath2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getFunctionName.js_commonjs-proxy +3 -0
- package/build/_virtual/getFunctionName.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getIndexes.js_commonjs-proxy +3 -0
- package/build/_virtual/getIndexes.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getModelsMapForPopulate.js_commonjs-proxy +3 -0
- package/build/_virtual/getModelsMapForPopulate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getPath.js_commonjs-proxy +3 -0
- package/build/_virtual/getPath.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getSchemaDiscriminatorByValue.js_commonjs-proxy +3 -0
- package/build/_virtual/getSchemaDiscriminatorByValue.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getSchemaTypes.js_commonjs-proxy +3 -0
- package/build/_virtual/getSchemaTypes.js_commonjs-proxy.map +1 -0
- package/build/_virtual/getVirtual.js_commonjs-proxy +3 -0
- package/build/_virtual/getVirtual.js_commonjs-proxy.map +1 -0
- package/build/_virtual/get_more.js_commonjs-proxy +3 -0
- package/build/_virtual/get_more.js_commonjs-proxy.map +1 -0
- package/build/_virtual/grid_store.js_commonjs-proxy +3 -0
- package/build/_virtual/grid_store.js_commonjs-proxy.map +1 -0
- package/build/_virtual/gssapi.js_commonjs-proxy +3 -0
- package/build/_virtual/gssapi.js_commonjs-proxy.map +1 -0
- package/build/_virtual/handleIdOption.js_commonjs-proxy +3 -0
- package/build/_virtual/handleIdOption.js_commonjs-proxy.map +1 -0
- package/build/_virtual/handleImmutable.js_commonjs-proxy +3 -0
- package/build/_virtual/handleImmutable.js_commonjs-proxy.map +1 -0
- package/build/_virtual/handleImmutable2.js_commonjs-proxy +3 -0
- package/build/_virtual/handleImmutable2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/handleSpreadDoc.js_commonjs-proxy +3 -0
- package/build/_virtual/handleSpreadDoc.js_commonjs-proxy.map +1 -0
- package/build/_virtual/handleTimestampOption.js_commonjs-proxy +3 -0
- package/build/_virtual/handleTimestampOption.js_commonjs-proxy.map +1 -0
- package/build/_virtual/hasDollarKeys.js_commonjs-proxy +3 -0
- package/build/_virtual/hasDollarKeys.js_commonjs-proxy.map +1 -0
- package/build/_virtual/helpers.js_commonjs-proxy +3 -0
- package/build/_virtual/helpers.js_commonjs-proxy.map +1 -0
- package/build/_virtual/hiredis.js_commonjs-proxy +3 -0
- package/build/_virtual/hiredis.js_commonjs-proxy.map +1 -0
- package/build/_virtual/idGetter.js_commonjs-proxy +3 -0
- package/build/_virtual/idGetter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/immediate.js_commonjs-proxy +3 -0
- package/build/_virtual/immediate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index.js_commonjs-proxy +3 -0
- package/build/_virtual/index.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index10.js_commonjs-proxy +3 -0
- package/build/_virtual/index10.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index11.js_commonjs-proxy +3 -0
- package/build/_virtual/index11.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index12.js_commonjs-proxy +3 -0
- package/build/_virtual/index12.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index13.js_commonjs-proxy +3 -0
- package/build/_virtual/index13.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index14.js_commonjs-proxy +3 -0
- package/build/_virtual/index14.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index15.js_commonjs-proxy +3 -0
- package/build/_virtual/index15.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index16.js_commonjs-proxy +3 -0
- package/build/_virtual/index16.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index17.js_commonjs-proxy +3 -0
- package/build/_virtual/index17.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index18.js_commonjs-proxy +3 -0
- package/build/_virtual/index18.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index19.js_commonjs-proxy +3 -0
- package/build/_virtual/index19.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index2.js_commonjs-proxy +3 -0
- package/build/_virtual/index2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index20.js_commonjs-proxy +3 -0
- package/build/_virtual/index20.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index21.js_commonjs-proxy +7 -0
- package/build/_virtual/index21.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index22.js_commonjs-proxy +3 -0
- package/build/_virtual/index22.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index23.js_commonjs-proxy +3 -0
- package/build/_virtual/index23.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index24.js_commonjs-proxy +3 -0
- package/build/_virtual/index24.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index25.js_commonjs-proxy +3 -0
- package/build/_virtual/index25.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index26.js_commonjs-proxy +3 -0
- package/build/_virtual/index26.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index27.js_commonjs-proxy +3 -0
- package/build/_virtual/index27.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index28.js_commonjs-proxy +3 -0
- package/build/_virtual/index28.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index29.js_commonjs-proxy +3 -0
- package/build/_virtual/index29.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index3.js_commonjs-proxy +3 -0
- package/build/_virtual/index3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index30.js_commonjs-proxy +3 -0
- package/build/_virtual/index30.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index31.js_commonjs-proxy +3 -0
- package/build/_virtual/index31.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index4.js_commonjs-proxy +3 -0
- package/build/_virtual/index4.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index5.js_commonjs-proxy +3 -0
- package/build/_virtual/index5.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index6.js_commonjs-proxy +3 -0
- package/build/_virtual/index6.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index7.js_commonjs-proxy +3 -0
- package/build/_virtual/index7.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index8.js_commonjs-proxy +3 -0
- package/build/_virtual/index8.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index9.js_commonjs-proxy +3 -0
- package/build/_virtual/index9.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index_exists.js_commonjs-proxy +3 -0
- package/build/_virtual/index_exists.js_commonjs-proxy.map +1 -0
- package/build/_virtual/index_information.js_commonjs-proxy +3 -0
- package/build/_virtual/index_information.js_commonjs-proxy.map +1 -0
- package/build/_virtual/indexes.js_commonjs-proxy +3 -0
- package/build/_virtual/indexes.js_commonjs-proxy.map +1 -0
- package/build/_virtual/inherits.js_commonjs-proxy +3 -0
- package/build/_virtual/inherits.js_commonjs-proxy.map +1 -0
- package/build/_virtual/inherits_browser.js_commonjs-proxy +3 -0
- package/build/_virtual/inherits_browser.js_commonjs-proxy.map +1 -0
- package/build/_virtual/insert_many.js_commonjs-proxy +3 -0
- package/build/_virtual/insert_many.js_commonjs-proxy.map +1 -0
- package/build/_virtual/insert_one.js_commonjs-proxy +3 -0
- package/build/_virtual/insert_one.js_commonjs-proxy.map +1 -0
- package/build/_virtual/int_32.js_commonjs-proxy +3 -0
- package/build/_virtual/int_32.js_commonjs-proxy.map +1 -0
- package/build/_virtual/internal.js_commonjs-proxy +3 -0
- package/build/_virtual/internal.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isAtlas.js_commonjs-proxy +3 -0
- package/build/_virtual/isAtlas.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isBsonType.js_commonjs-proxy +3 -0
- package/build/_virtual/isBsonType.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isDefaultIdIndex.js_commonjs-proxy +3 -0
- package/build/_virtual/isDefaultIdIndex.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isDefiningProjection.js_commonjs-proxy +3 -0
- package/build/_virtual/isDefiningProjection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isExclusive.js_commonjs-proxy +3 -0
- package/build/_virtual/isExclusive.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isInclusive.js_commonjs-proxy +3 -0
- package/build/_virtual/isInclusive.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isIndexEqual.js_commonjs-proxy +3 -0
- package/build/_virtual/isIndexEqual.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isMongooseObject.js_commonjs-proxy +3 -0
- package/build/_virtual/isMongooseObject.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isObject.js_commonjs-proxy +3 -0
- package/build/_virtual/isObject.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isOperator.js_commonjs-proxy +3 -0
- package/build/_virtual/isOperator.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isPathExcluded.js_commonjs-proxy +3 -0
- package/build/_virtual/isPathExcluded.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isPathSelectedInclusive.js_commonjs-proxy +3 -0
- package/build/_virtual/isPathSelectedInclusive.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isPromise.js_commonjs-proxy +3 -0
- package/build/_virtual/isPromise.js_commonjs-proxy.map +1 -0
- package/build/_virtual/isSSLError.js_commonjs-proxy +3 -0
- package/build/_virtual/isSSLError.js_commonjs-proxy.map +1 -0
- package/build/_virtual/is_capped.js_commonjs-proxy +3 -0
- package/build/_virtual/is_capped.js_commonjs-proxy.map +1 -0
- package/build/_virtual/join.js_commonjs-proxy +3 -0
- package/build/_virtual/join.js_commonjs-proxy.map +1 -0
- package/build/_virtual/kill_cursors.js_commonjs-proxy +3 -0
- package/build/_virtual/kill_cursors.js_commonjs-proxy.map +1 -0
- package/build/_virtual/leanPopulateMap.js_commonjs-proxy +3 -0
- package/build/_virtual/leanPopulateMap.js_commonjs-proxy.map +1 -0
- package/build/_virtual/limiter.js_commonjs-proxy +3 -0
- package/build/_virtual/limiter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/list_collections.js_commonjs-proxy +3 -0
- package/build/_virtual/list_collections.js_commonjs-proxy.map +1 -0
- package/build/_virtual/list_databases.js_commonjs-proxy +3 -0
- package/build/_virtual/list_databases.js_commonjs-proxy.map +1 -0
- package/build/_virtual/list_indexes.js_commonjs-proxy +3 -0
- package/build/_virtual/list_indexes.js_commonjs-proxy.map +1 -0
- package/build/_virtual/logger.js_commonjs-proxy +3 -0
- package/build/_virtual/logger.js_commonjs-proxy.map +1 -0
- package/build/_virtual/long.js_commonjs-proxy +3 -0
- package/build/_virtual/long.js_commonjs-proxy.map +1 -0
- package/build/_virtual/lookupLocalFields.js_commonjs-proxy +3 -0
- package/build/_virtual/lookupLocalFields.js_commonjs-proxy.map +1 -0
- package/build/_virtual/lru.js_commonjs-proxy +3 -0
- package/build/_virtual/lru.js_commonjs-proxy.map +1 -0
- package/build/_virtual/map.js_commonjs-proxy +3 -0
- package/build/_virtual/map.js_commonjs-proxy.map +1 -0
- package/build/_virtual/map2.js_commonjs-proxy +3 -0
- package/build/_virtual/map2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/map3.js_commonjs-proxy +3 -0
- package/build/_virtual/map3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/map4.js_commonjs-proxy +3 -0
- package/build/_virtual/map4.js_commonjs-proxy.map +1 -0
- package/build/_virtual/map_reduce.js_commonjs-proxy +3 -0
- package/build/_virtual/map_reduce.js_commonjs-proxy.map +1 -0
- package/build/_virtual/max_key.js_commonjs-proxy +3 -0
- package/build/_virtual/max_key.js_commonjs-proxy.map +1 -0
- package/build/_virtual/memory-code-points.js_commonjs-proxy +3 -0
- package/build/_virtual/memory-code-points.js_commonjs-proxy.map +1 -0
- package/build/_virtual/merge.js_commonjs-proxy +3 -0
- package/build/_virtual/merge.js_commonjs-proxy.map +1 -0
- package/build/_virtual/message_stream.js_commonjs-proxy +3 -0
- package/build/_virtual/message_stream.js_commonjs-proxy.map +1 -0
- package/build/_virtual/messages.js_commonjs-proxy +3 -0
- package/build/_virtual/messages.js_commonjs-proxy.map +1 -0
- package/build/_virtual/method.js_commonjs-proxy +3 -0
- package/build/_virtual/method.js_commonjs-proxy.map +1 -0
- package/build/_virtual/min_key.js_commonjs-proxy +3 -0
- package/build/_virtual/min_key.js_commonjs-proxy.map +1 -0
- package/build/_virtual/missingSchema.js_commonjs-proxy +3 -0
- package/build/_virtual/missingSchema.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mixed.js_commonjs-proxy +3 -0
- package/build/_virtual/mixed.js_commonjs-proxy.map +1 -0
- package/build/_virtual/model.js_commonjs-proxy +3 -0
- package/build/_virtual/model.js_commonjs-proxy.map +1 -0
- package/build/_virtual/modifiedPaths.js_commonjs-proxy +3 -0
- package/build/_virtual/modifiedPaths.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mongo_client.js_commonjs-proxy +3 -0
- package/build/_virtual/mongo_client.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mongo_credentials.js_commonjs-proxy +3 -0
- package/build/_virtual/mongo_credentials.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mongocr.js_commonjs-proxy +3 -0
- package/build/_virtual/mongocr.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mongodb_aws.js_commonjs-proxy +3 -0
- package/build/_virtual/mongodb_aws.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mongooseError.js_commonjs-proxy +3 -0
- package/build/_virtual/mongooseError.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mongos.js_commonjs-proxy +3 -0
- package/build/_virtual/mongos.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mongos2.js_commonjs-proxy +3 -0
- package/build/_virtual/mongos2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/monitor.js_commonjs-proxy +3 -0
- package/build/_virtual/monitor.js_commonjs-proxy.map +1 -0
- package/build/_virtual/moveImmutableProperties.js_commonjs-proxy +3 -0
- package/build/_virtual/moveImmutableProperties.js_commonjs-proxy.map +1 -0
- package/build/_virtual/mquery.js_commonjs-proxy +3 -0
- package/build/_virtual/mquery.js_commonjs-proxy.map +1 -0
- package/build/_virtual/msg.js_commonjs-proxy +3 -0
- package/build/_virtual/msg.js_commonjs-proxy.map +1 -0
- package/build/_virtual/multi.js_commonjs-proxy +3 -0
- package/build/_virtual/multi.js_commonjs-proxy.map +1 -0
- package/build/_virtual/native_topology.js_commonjs-proxy +3 -0
- package/build/_virtual/native_topology.js_commonjs-proxy.map +1 -0
- package/build/_virtual/node.js_commonjs-proxy +3 -0
- package/build/_virtual/node.js_commonjs-proxy.map +1 -0
- package/build/_virtual/node2.js_commonjs-proxy +3 -0
- package/build/_virtual/node2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/nodeback.js_commonjs-proxy +3 -0
- package/build/_virtual/nodeback.js_commonjs-proxy.map +1 -0
- package/build/_virtual/nodeify.js_commonjs-proxy +3 -0
- package/build/_virtual/nodeify.js_commonjs-proxy.map +1 -0
- package/build/_virtual/normalizeRefPath.js_commonjs-proxy +3 -0
- package/build/_virtual/normalizeRefPath.js_commonjs-proxy.map +1 -0
- package/build/_virtual/notFound.js_commonjs-proxy +3 -0
- package/build/_virtual/notFound.js_commonjs-proxy.map +1 -0
- package/build/_virtual/number.js_commonjs-proxy +3 -0
- package/build/_virtual/number.js_commonjs-proxy.map +1 -0
- package/build/_virtual/number2.js_commonjs-proxy +3 -0
- package/build/_virtual/number2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/objectExpected.js_commonjs-proxy +3 -0
- package/build/_virtual/objectExpected.js_commonjs-proxy.map +1 -0
- package/build/_virtual/objectParameter.js_commonjs-proxy +3 -0
- package/build/_virtual/objectParameter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/objectid.js_commonjs-proxy +3 -0
- package/build/_virtual/objectid.js_commonjs-proxy.map +1 -0
- package/build/_virtual/objectid2.js_commonjs-proxy +3 -0
- package/build/_virtual/objectid2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/objectid3.js_commonjs-proxy +3 -0
- package/build/_virtual/objectid3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/objectid4.js_commonjs-proxy +3 -0
- package/build/_virtual/objectid4.js_commonjs-proxy.map +1 -0
- package/build/_virtual/objectid5.js_commonjs-proxy +3 -0
- package/build/_virtual/objectid5.js_commonjs-proxy.map +1 -0
- package/build/_virtual/operation.js_commonjs-proxy +3 -0
- package/build/_virtual/operation.js_commonjs-proxy.map +1 -0
- package/build/_virtual/options.js_commonjs-proxy +3 -0
- package/build/_virtual/options.js_commonjs-proxy.map +1 -0
- package/build/_virtual/options_operation.js_commonjs-proxy +3 -0
- package/build/_virtual/options_operation.js_commonjs-proxy.map +1 -0
- package/build/_virtual/ordered.js_commonjs-proxy +3 -0
- package/build/_virtual/ordered.js_commonjs-proxy.map +1 -0
- package/build/_virtual/overwriteModel.js_commonjs-proxy +3 -0
- package/build/_virtual/overwriteModel.js_commonjs-proxy.map +1 -0
- package/build/_virtual/parallelLimit.js_commonjs-proxy +3 -0
- package/build/_virtual/parallelLimit.js_commonjs-proxy.map +1 -0
- package/build/_virtual/parallelSave.js_commonjs-proxy +3 -0
- package/build/_virtual/parallelSave.js_commonjs-proxy.map +1 -0
- package/build/_virtual/parallelValidate.js_commonjs-proxy +3 -0
- package/build/_virtual/parallelValidate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/parentPaths.js_commonjs-proxy +3 -0
- package/build/_virtual/parentPaths.js_commonjs-proxy.map +1 -0
- package/build/_virtual/parseProjection.js_commonjs-proxy +3 -0
- package/build/_virtual/parseProjection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/parser.js_commonjs-proxy +3 -0
- package/build/_virtual/parser.js_commonjs-proxy.map +1 -0
- package/build/_virtual/parserError.js_commonjs-proxy +3 -0
- package/build/_virtual/parserError.js_commonjs-proxy.map +1 -0
- package/build/_virtual/permessage-deflate.js_commonjs-proxy +3 -0
- package/build/_virtual/permessage-deflate.js_commonjs-proxy.map +1 -0
- package/build/_virtual/permissions.js_commonjs-proxy +3 -0
- package/build/_virtual/permissions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/plain.js_commonjs-proxy +3 -0
- package/build/_virtual/plain.js_commonjs-proxy.map +1 -0
- package/build/_virtual/pool.js_commonjs-proxy +3 -0
- package/build/_virtual/pool.js_commonjs-proxy.map +1 -0
- package/build/_virtual/profiling_level.js_commonjs-proxy +3 -0
- package/build/_virtual/profiling_level.js_commonjs-proxy.map +1 -0
- package/build/_virtual/promise.js_commonjs-proxy +3 -0
- package/build/_virtual/promise.js_commonjs-proxy.map +1 -0
- package/build/_virtual/promiseOrCallback.js_commonjs-proxy +3 -0
- package/build/_virtual/promiseOrCallback.js_commonjs-proxy.map +1 -0
- package/build/_virtual/promise_array.js_commonjs-proxy +3 -0
- package/build/_virtual/promise_array.js_commonjs-proxy.map +1 -0
- package/build/_virtual/promise_provider.js_commonjs-proxy +3 -0
- package/build/_virtual/promise_provider.js_commonjs-proxy.map +1 -0
- package/build/_virtual/promisify.js_commonjs-proxy +3 -0
- package/build/_virtual/promisify.js_commonjs-proxy.map +1 -0
- package/build/_virtual/propertyOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/propertyOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/props.js_commonjs-proxy +3 -0
- package/build/_virtual/props.js_commonjs-proxy.map +1 -0
- package/build/_virtual/query.js_commonjs-proxy +3 -0
- package/build/_virtual/query.js_commonjs-proxy.map +1 -0
- package/build/_virtual/query2.js_commonjs-proxy +3 -0
- package/build/_virtual/query2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/queryhelpers.js_commonjs-proxy +3 -0
- package/build/_virtual/queryhelpers.js_commonjs-proxy.map +1 -0
- package/build/_virtual/queue.js_commonjs-proxy +3 -0
- package/build/_virtual/queue.js_commonjs-proxy.map +1 -0
- package/build/_virtual/race.js_commonjs-proxy +3 -0
- package/build/_virtual/race.js_commonjs-proxy.map +1 -0
- package/build/_virtual/re_index.js_commonjs-proxy +3 -0
- package/build/_virtual/re_index.js_commonjs-proxy.map +1 -0
- package/build/_virtual/read_concern.js_commonjs-proxy +3 -0
- package/build/_virtual/read_concern.js_commonjs-proxy.map +1 -0
- package/build/_virtual/read_preference.js_commonjs-proxy +3 -0
- package/build/_virtual/read_preference.js_commonjs-proxy.map +1 -0
- package/build/_virtual/readable.js_commonjs-proxy +3 -0
- package/build/_virtual/readable.js_commonjs-proxy.map +1 -0
- package/build/_virtual/receiver.js_commonjs-proxy +3 -0
- package/build/_virtual/receiver.js_commonjs-proxy.map +1 -0
- package/build/_virtual/redisError.js_commonjs-proxy +3 -0
- package/build/_virtual/redisError.js_commonjs-proxy.map +1 -0
- package/build/_virtual/reduce.js_commonjs-proxy +3 -0
- package/build/_virtual/reduce.js_commonjs-proxy.map +1 -0
- package/build/_virtual/regexp.js_commonjs-proxy +3 -0
- package/build/_virtual/regexp.js_commonjs-proxy.map +1 -0
- package/build/_virtual/removeDeselectedForeignField.js_commonjs-proxy +3 -0
- package/build/_virtual/removeDeselectedForeignField.js_commonjs-proxy.map +1 -0
- package/build/_virtual/removeOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/removeOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/removeSubdocs.js_commonjs-proxy +3 -0
- package/build/_virtual/removeSubdocs.js_commonjs-proxy.map +1 -0
- package/build/_virtual/removeUnusedArrayFilters.js_commonjs-proxy +3 -0
- package/build/_virtual/removeUnusedArrayFilters.js_commonjs-proxy.map +1 -0
- package/build/_virtual/remove_user.js_commonjs-proxy +3 -0
- package/build/_virtual/remove_user.js_commonjs-proxy.map +1 -0
- package/build/_virtual/rename.js_commonjs-proxy +3 -0
- package/build/_virtual/rename.js_commonjs-proxy.map +1 -0
- package/build/_virtual/replace_one.js_commonjs-proxy +3 -0
- package/build/_virtual/replace_one.js_commonjs-proxy.map +1 -0
- package/build/_virtual/replset.js_commonjs-proxy +3 -0
- package/build/_virtual/replset.js_commonjs-proxy.map +1 -0
- package/build/_virtual/replset2.js_commonjs-proxy +3 -0
- package/build/_virtual/replset2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/replset_state.js_commonjs-proxy +3 -0
- package/build/_virtual/replset_state.js_commonjs-proxy.map +1 -0
- package/build/_virtual/replyError.js_commonjs-proxy +3 -0
- package/build/_virtual/replyError.js_commonjs-proxy.map +1 -0
- package/build/_virtual/run_command.js_commonjs-proxy +3 -0
- package/build/_virtual/run_command.js_commonjs-proxy.map +1 -0
- package/build/_virtual/sanitizeProjection.js_commonjs-proxy +3 -0
- package/build/_virtual/sanitizeProjection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/saveOptions.js_commonjs-proxy +3 -0
- package/build/_virtual/saveOptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/saveSubdocs.js_commonjs-proxy +3 -0
- package/build/_virtual/saveSubdocs.js_commonjs-proxy.map +1 -0
- package/build/_virtual/schedule.js_commonjs-proxy +3 -0
- package/build/_virtual/schedule.js_commonjs-proxy.map +1 -0
- package/build/_virtual/schema.js_commonjs-proxy +3 -0
- package/build/_virtual/schema.js_commonjs-proxy.map +1 -0
- package/build/_virtual/schematype.js_commonjs-proxy +3 -0
- package/build/_virtual/schematype.js_commonjs-proxy.map +1 -0
- package/build/_virtual/scram.js_commonjs-proxy +3 -0
- package/build/_virtual/scram.js_commonjs-proxy.map +1 -0
- package/build/_virtual/selectPopulatedFields.js_commonjs-proxy +3 -0
- package/build/_virtual/selectPopulatedFields.js_commonjs-proxy.map +1 -0
- package/build/_virtual/sender.js_commonjs-proxy +3 -0
- package/build/_virtual/sender.js_commonjs-proxy.map +1 -0
- package/build/_virtual/serializer.js_commonjs-proxy +3 -0
- package/build/_virtual/serializer.js_commonjs-proxy.map +1 -0
- package/build/_virtual/server.js_commonjs-proxy +3 -0
- package/build/_virtual/server.js_commonjs-proxy.map +1 -0
- package/build/_virtual/server2.js_commonjs-proxy +3 -0
- package/build/_virtual/server2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/server3.js_commonjs-proxy +3 -0
- package/build/_virtual/server3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/serverSelection.js_commonjs-proxy +3 -0
- package/build/_virtual/serverSelection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/server_description.js_commonjs-proxy +3 -0
- package/build/_virtual/server_description.js_commonjs-proxy.map +1 -0
- package/build/_virtual/server_selection.js_commonjs-proxy +3 -0
- package/build/_virtual/server_selection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/sessions.js_commonjs-proxy +3 -0
- package/build/_virtual/sessions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/setDefaultsOnInsert.js_commonjs-proxy +3 -0
- package/build/_virtual/setDefaultsOnInsert.js_commonjs-proxy.map +1 -0
- package/build/_virtual/setDottedPath.js_commonjs-proxy +3 -0
- package/build/_virtual/setDottedPath.js_commonjs-proxy.map +1 -0
- package/build/_virtual/set_profiling_level.js_commonjs-proxy +3 -0
- package/build/_virtual/set_profiling_level.js_commonjs-proxy.map +1 -0
- package/build/_virtual/settle.js_commonjs-proxy +3 -0
- package/build/_virtual/settle.js_commonjs-proxy.map +1 -0
- package/build/_virtual/setupTimestamps.js_commonjs-proxy +3 -0
- package/build/_virtual/setupTimestamps.js_commonjs-proxy.map +1 -0
- package/build/_virtual/sharding.js_commonjs-proxy +3 -0
- package/build/_virtual/sharding.js_commonjs-proxy.map +1 -0
- package/build/_virtual/shared.js_commonjs-proxy +3 -0
- package/build/_virtual/shared.js_commonjs-proxy.map +1 -0
- package/build/_virtual/shared2.js_commonjs-proxy +3 -0
- package/build/_virtual/shared2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/some.js_commonjs-proxy +3 -0
- package/build/_virtual/some.js_commonjs-proxy.map +1 -0
- package/build/_virtual/specialProperties.js_commonjs-proxy +3 -0
- package/build/_virtual/specialProperties.js_commonjs-proxy.map +1 -0
- package/build/_virtual/srv_polling.js_commonjs-proxy +3 -0
- package/build/_virtual/srv_polling.js_commonjs-proxy.map +1 -0
- package/build/_virtual/statemachine.js_commonjs-proxy +3 -0
- package/build/_virtual/statemachine.js_commonjs-proxy.map +1 -0
- package/build/_virtual/stats.js_commonjs-proxy +3 -0
- package/build/_virtual/stats.js_commonjs-proxy.map +1 -0
- package/build/_virtual/stream.js_commonjs-proxy +3 -0
- package/build/_virtual/stream.js_commonjs-proxy.map +1 -0
- package/build/_virtual/stream2.js_commonjs-proxy +3 -0
- package/build/_virtual/stream2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/stream_description.js_commonjs-proxy +3 -0
- package/build/_virtual/stream_description.js_commonjs-proxy.map +1 -0
- package/build/_virtual/strict.js_commonjs-proxy +3 -0
- package/build/_virtual/strict.js_commonjs-proxy.map +1 -0
- package/build/_virtual/string.js_commonjs-proxy +3 -0
- package/build/_virtual/string.js_commonjs-proxy.map +1 -0
- package/build/_virtual/string2.js_commonjs-proxy +3 -0
- package/build/_virtual/string2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/stringToParts.js_commonjs-proxy +3 -0
- package/build/_virtual/stringToParts.js_commonjs-proxy.map +1 -0
- package/build/_virtual/string_decoder.js_commonjs-proxy +3 -0
- package/build/_virtual/string_decoder.js_commonjs-proxy.map +1 -0
- package/build/_virtual/stringifyFunctionOperators.js_commonjs-proxy +3 -0
- package/build/_virtual/stringifyFunctionOperators.js_commonjs-proxy.map +1 -0
- package/build/_virtual/subdocument.js_commonjs-proxy +3 -0
- package/build/_virtual/subdocument.js_commonjs-proxy.map +1 -0
- package/build/_virtual/symbol.js_commonjs-proxy +3 -0
- package/build/_virtual/symbol.js_commonjs-proxy.map +1 -0
- package/build/_virtual/symbols.js_commonjs-proxy +3 -0
- package/build/_virtual/symbols.js_commonjs-proxy.map +1 -0
- package/build/_virtual/symbols2.js_commonjs-proxy +3 -0
- package/build/_virtual/symbols2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/synchronous_inspection.js_commonjs-proxy +3 -0
- package/build/_virtual/synchronous_inspection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/text.js_commonjs-proxy +3 -0
- package/build/_virtual/text.js_commonjs-proxy.map +1 -0
- package/build/_virtual/thenables.js_commonjs-proxy +3 -0
- package/build/_virtual/thenables.js_commonjs-proxy.map +1 -0
- package/build/_virtual/timers.js_commonjs-proxy +3 -0
- package/build/_virtual/timers.js_commonjs-proxy.map +1 -0
- package/build/_virtual/timers2.js_commonjs-proxy +3 -0
- package/build/_virtual/timers2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/timestamp.js_commonjs-proxy +3 -0
- package/build/_virtual/timestamp.js_commonjs-proxy.map +1 -0
- package/build/_virtual/topology.js_commonjs-proxy +3 -0
- package/build/_virtual/topology.js_commonjs-proxy.map +1 -0
- package/build/_virtual/topology_base.js_commonjs-proxy +3 -0
- package/build/_virtual/topology_base.js_commonjs-proxy.map +1 -0
- package/build/_virtual/topology_description.js_commonjs-proxy +3 -0
- package/build/_virtual/topology_description.js_commonjs-proxy.map +1 -0
- package/build/_virtual/trackTransaction.js_commonjs-proxy +3 -0
- package/build/_virtual/trackTransaction.js_commonjs-proxy.map +1 -0
- package/build/_virtual/transactions.js_commonjs-proxy +3 -0
- package/build/_virtual/transactions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/type.js_commonjs-proxy +3 -0
- package/build/_virtual/type.js_commonjs-proxy.map +1 -0
- package/build/_virtual/unordered.js_commonjs-proxy +3 -0
- package/build/_virtual/unordered.js_commonjs-proxy.map +1 -0
- package/build/_virtual/updateValidators.js_commonjs-proxy +3 -0
- package/build/_virtual/updateValidators.js_commonjs-proxy.map +1 -0
- package/build/_virtual/update_many.js_commonjs-proxy +3 -0
- package/build/_virtual/update_many.js_commonjs-proxy.map +1 -0
- package/build/_virtual/update_one.js_commonjs-proxy +3 -0
- package/build/_virtual/update_one.js_commonjs-proxy.map +1 -0
- package/build/_virtual/updatedPathsByArrayFilter.js_commonjs-proxy +3 -0
- package/build/_virtual/updatedPathsByArrayFilter.js_commonjs-proxy.map +1 -0
- package/build/_virtual/upload.js_commonjs-proxy +3 -0
- package/build/_virtual/upload.js_commonjs-proxy.map +1 -0
- package/build/_virtual/uri_parser.js_commonjs-proxy +3 -0
- package/build/_virtual/uri_parser.js_commonjs-proxy.map +1 -0
- package/build/_virtual/url_parser.js_commonjs-proxy +3 -0
- package/build/_virtual/url_parser.js_commonjs-proxy.map +1 -0
- package/build/_virtual/using.js_commonjs-proxy +3 -0
- package/build/_virtual/using.js_commonjs-proxy.map +1 -0
- package/build/_virtual/util.js_commonjs-proxy +3 -0
- package/build/_virtual/util.js_commonjs-proxy.map +1 -0
- package/build/_virtual/util2.js_commonjs-proxy +3 -0
- package/build/_virtual/util2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/utils.js_commonjs-proxy +3 -0
- package/build/_virtual/utils.js_commonjs-proxy.map +1 -0
- package/build/_virtual/utils2.js_commonjs-proxy +3 -0
- package/build/_virtual/utils2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/utils3.js_commonjs-proxy +3 -0
- package/build/_virtual/utils3.js_commonjs-proxy.map +1 -0
- package/build/_virtual/utils4.js_commonjs-proxy +3 -0
- package/build/_virtual/utils4.js_commonjs-proxy.map +1 -0
- package/build/_virtual/utils5.js_commonjs-proxy +3 -0
- package/build/_virtual/utils5.js_commonjs-proxy.map +1 -0
- package/build/_virtual/utils6.js_commonjs-proxy +3 -0
- package/build/_virtual/utils6.js_commonjs-proxy.map +1 -0
- package/build/_virtual/utils7.js_commonjs-proxy +3 -0
- package/build/_virtual/utils7.js_commonjs-proxy.map +1 -0
- package/build/_virtual/validateBeforeSave.js_commonjs-proxy +3 -0
- package/build/_virtual/validateBeforeSave.js_commonjs-proxy.map +1 -0
- package/build/_virtual/validateRef.js_commonjs-proxy +3 -0
- package/build/_virtual/validateRef.js_commonjs-proxy.map +1 -0
- package/build/_virtual/validate_collection.js_commonjs-proxy +3 -0
- package/build/_virtual/validate_collection.js_commonjs-proxy.map +1 -0
- package/build/_virtual/validation.js_commonjs-proxy +3 -0
- package/build/_virtual/validation.js_commonjs-proxy.map +1 -0
- package/build/_virtual/validation2.js_commonjs-proxy +3 -0
- package/build/_virtual/validation2.js_commonjs-proxy.map +1 -0
- package/build/_virtual/validator.js_commonjs-proxy +3 -0
- package/build/_virtual/validator.js_commonjs-proxy.map +1 -0
- package/build/_virtual/validoptions.js_commonjs-proxy +3 -0
- package/build/_virtual/validoptions.js_commonjs-proxy.map +1 -0
- package/build/_virtual/version.js_commonjs-proxy +3 -0
- package/build/_virtual/version.js_commonjs-proxy.map +1 -0
- package/build/_virtual/virtualtype.js_commonjs-proxy +3 -0
- package/build/_virtual/virtualtype.js_commonjs-proxy.map +1 -0
- package/build/_virtual/websocket-server.js_commonjs-proxy +3 -0
- package/build/_virtual/websocket-server.js_commonjs-proxy.map +1 -0
- package/build/_virtual/websocket.js_commonjs-proxy +3 -0
- package/build/_virtual/websocket.js_commonjs-proxy.map +1 -0
- package/build/_virtual/wrapThunk.js_commonjs-proxy +3 -0
- package/build/_virtual/wrapThunk.js_commonjs-proxy.map +1 -0
- package/build/_virtual/write_command.js_commonjs-proxy +3 -0
- package/build/_virtual/write_command.js_commonjs-proxy.map +1 -0
- package/build/_virtual/write_concern.js_commonjs-proxy +3 -0
- package/build/_virtual/write_concern.js_commonjs-proxy.map +1 -0
- package/build/_virtual/x509.js_commonjs-proxy +3 -0
- package/build/_virtual/x509.js_commonjs-proxy.map +1 -0
- package/build/bundles/colyseus/build/index.mjs +13 -0
- package/build/bundles/colyseus/build/index.mjs.js +25 -0
- package/build/bundles/colyseus/build/index.mjs.js.map +1 -0
- package/build/bundles/colyseus/build/index.mjs.map +1 -0
- package/build/matchmaker/controller.js +3 -1
- package/build/matchmaker/controller.js.map +1 -1
- package/build/matchmaker/controller.mjs +3 -1
- package/build/matchmaker/controller.mjs.map +1 -1
- package/build/node_modules/aws4/aws4.js +388 -0
- package/build/node_modules/aws4/aws4.js.map +1 -0
- package/build/node_modules/aws4/aws4.mjs +380 -0
- package/build/node_modules/aws4/aws4.mjs.map +1 -0
- package/build/node_modules/aws4/lru.js +101 -0
- package/build/node_modules/aws4/lru.js.map +1 -0
- package/build/node_modules/aws4/lru.mjs +99 -0
- package/build/node_modules/aws4/lru.mjs.map +1 -0
- package/build/node_modules/bl/bl.js +403 -0
- package/build/node_modules/bl/bl.js.map +1 -0
- package/build/node_modules/bl/bl.mjs +397 -0
- package/build/node_modules/bl/bl.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +114 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.mjs +112 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +29 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.mjs +27 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +1020 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.mjs +1013 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +158 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.mjs +156 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +667 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.mjs +665 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/BufferList.js +93 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/BufferList.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/BufferList.mjs +87 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/BufferList.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js +79 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.mjs +77 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js +12 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.mjs +6 -0
- package/build/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/readable.js +37 -0
- package/build/node_modules/bl/node_modules/readable-stream/readable.js.map +1 -0
- package/build/node_modules/bl/node_modules/readable-stream/readable.mjs +31 -0
- package/build/node_modules/bl/node_modules/readable-stream/readable.mjs.map +1 -0
- package/build/node_modules/bl/node_modules/string_decoder/lib/string_decoder.js +286 -0
- package/build/node_modules/bl/node_modules/string_decoder/lib/string_decoder.js.map +1 -0
- package/build/node_modules/bl/node_modules/string_decoder/lib/string_decoder.mjs +282 -0
- package/build/node_modules/bl/node_modules/string_decoder/lib/string_decoder.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/any.js +25 -0
- package/build/node_modules/bluebird/js/release/any.js.map +1 -0
- package/build/node_modules/bluebird/js/release/any.mjs +23 -0
- package/build/node_modules/bluebird/js/release/any.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/async.js +173 -0
- package/build/node_modules/bluebird/js/release/async.js.map +1 -0
- package/build/node_modules/bluebird/js/release/async.mjs +169 -0
- package/build/node_modules/bluebird/js/release/async.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/bind.js +71 -0
- package/build/node_modules/bluebird/js/release/bind.js.map +1 -0
- package/build/node_modules/bluebird/js/release/bind.mjs +69 -0
- package/build/node_modules/bluebird/js/release/bind.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/bluebird.js +17 -0
- package/build/node_modules/bluebird/js/release/bluebird.js.map +1 -0
- package/build/node_modules/bluebird/js/release/bluebird.mjs +15 -0
- package/build/node_modules/bluebird/js/release/bluebird.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/call_get.js +128 -0
- package/build/node_modules/bluebird/js/release/call_get.js.map +1 -0
- package/build/node_modules/bluebird/js/release/call_get.mjs +126 -0
- package/build/node_modules/bluebird/js/release/call_get.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/cancel.js +135 -0
- package/build/node_modules/bluebird/js/release/cancel.js.map +1 -0
- package/build/node_modules/bluebird/js/release/cancel.mjs +133 -0
- package/build/node_modules/bluebird/js/release/cancel.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/catch_filter.js +49 -0
- package/build/node_modules/bluebird/js/release/catch_filter.js.map +1 -0
- package/build/node_modules/bluebird/js/release/catch_filter.mjs +47 -0
- package/build/node_modules/bluebird/js/release/catch_filter.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/context.js +73 -0
- package/build/node_modules/bluebird/js/release/context.js.map +1 -0
- package/build/node_modules/bluebird/js/release/context.mjs +71 -0
- package/build/node_modules/bluebird/js/release/context.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/debuggability.js +922 -0
- package/build/node_modules/bluebird/js/release/debuggability.js.map +1 -0
- package/build/node_modules/bluebird/js/release/debuggability.mjs +920 -0
- package/build/node_modules/bluebird/js/release/debuggability.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/direct_resolve.js +50 -0
- package/build/node_modules/bluebird/js/release/direct_resolve.js.map +1 -0
- package/build/node_modules/bluebird/js/release/direct_resolve.mjs +48 -0
- package/build/node_modules/bluebird/js/release/direct_resolve.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/each.js +33 -0
- package/build/node_modules/bluebird/js/release/each.js.map +1 -0
- package/build/node_modules/bluebird/js/release/each.mjs +31 -0
- package/build/node_modules/bluebird/js/release/each.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/errors.js +122 -0
- package/build/node_modules/bluebird/js/release/errors.js.map +1 -0
- package/build/node_modules/bluebird/js/release/errors.mjs +120 -0
- package/build/node_modules/bluebird/js/release/errors.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/es5.js +88 -0
- package/build/node_modules/bluebird/js/release/es5.js.map +1 -0
- package/build/node_modules/bluebird/js/release/es5.mjs +86 -0
- package/build/node_modules/bluebird/js/release/es5.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/filter.js +16 -0
- package/build/node_modules/bluebird/js/release/filter.js.map +1 -0
- package/build/node_modules/bluebird/js/release/filter.mjs +14 -0
- package/build/node_modules/bluebird/js/release/filter.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/finally.js +153 -0
- package/build/node_modules/bluebird/js/release/finally.js.map +1 -0
- package/build/node_modules/bluebird/js/release/finally.mjs +151 -0
- package/build/node_modules/bluebird/js/release/finally.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/generators.js +229 -0
- package/build/node_modules/bluebird/js/release/generators.js.map +1 -0
- package/build/node_modules/bluebird/js/release/generators.mjs +227 -0
- package/build/node_modules/bluebird/js/release/generators.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/join.js +172 -0
- package/build/node_modules/bluebird/js/release/join.js.map +1 -0
- package/build/node_modules/bluebird/js/release/join.mjs +170 -0
- package/build/node_modules/bluebird/js/release/join.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/map.js +173 -0
- package/build/node_modules/bluebird/js/release/map.js.map +1 -0
- package/build/node_modules/bluebird/js/release/map.mjs +171 -0
- package/build/node_modules/bluebird/js/release/map.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/method.js +61 -0
- package/build/node_modules/bluebird/js/release/method.js.map +1 -0
- package/build/node_modules/bluebird/js/release/method.mjs +59 -0
- package/build/node_modules/bluebird/js/release/method.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/nodeback.js +57 -0
- package/build/node_modules/bluebird/js/release/nodeback.js.map +1 -0
- package/build/node_modules/bluebird/js/release/nodeback.mjs +55 -0
- package/build/node_modules/bluebird/js/release/nodeback.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/nodeify.js +64 -0
- package/build/node_modules/bluebird/js/release/nodeify.js.map +1 -0
- package/build/node_modules/bluebird/js/release/nodeify.mjs +62 -0
- package/build/node_modules/bluebird/js/release/nodeify.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/promise.js +815 -0
- package/build/node_modules/bluebird/js/release/promise.js.map +1 -0
- package/build/node_modules/bluebird/js/release/promise.mjs +813 -0
- package/build/node_modules/bluebird/js/release/promise.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/promise_array.js +190 -0
- package/build/node_modules/bluebird/js/release/promise_array.js.map +1 -0
- package/build/node_modules/bluebird/js/release/promise_array.mjs +188 -0
- package/build/node_modules/bluebird/js/release/promise_array.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/promisify.js +321 -0
- package/build/node_modules/bluebird/js/release/promisify.js.map +1 -0
- package/build/node_modules/bluebird/js/release/promisify.mjs +319 -0
- package/build/node_modules/bluebird/js/release/promisify.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/props.js +125 -0
- package/build/node_modules/bluebird/js/release/props.js.map +1 -0
- package/build/node_modules/bluebird/js/release/props.mjs +123 -0
- package/build/node_modules/bluebird/js/release/props.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/queue.js +77 -0
- package/build/node_modules/bluebird/js/release/queue.js.map +1 -0
- package/build/node_modules/bluebird/js/release/queue.mjs +75 -0
- package/build/node_modules/bluebird/js/release/queue.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/race.js +55 -0
- package/build/node_modules/bluebird/js/release/race.js.map +1 -0
- package/build/node_modules/bluebird/js/release/race.mjs +53 -0
- package/build/node_modules/bluebird/js/release/race.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/reduce.js +178 -0
- package/build/node_modules/bluebird/js/release/reduce.js.map +1 -0
- package/build/node_modules/bluebird/js/release/reduce.mjs +176 -0
- package/build/node_modules/bluebird/js/release/reduce.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/schedule.js +67 -0
- package/build/node_modules/bluebird/js/release/schedule.js.map +1 -0
- package/build/node_modules/bluebird/js/release/schedule.mjs +65 -0
- package/build/node_modules/bluebird/js/release/schedule.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/settle.js +49 -0
- package/build/node_modules/bluebird/js/release/settle.js.map +1 -0
- package/build/node_modules/bluebird/js/release/settle.mjs +47 -0
- package/build/node_modules/bluebird/js/release/settle.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/some.js +155 -0
- package/build/node_modules/bluebird/js/release/some.js.map +1 -0
- package/build/node_modules/bluebird/js/release/some.mjs +153 -0
- package/build/node_modules/bluebird/js/release/some.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/synchronous_inspection.js +107 -0
- package/build/node_modules/bluebird/js/release/synchronous_inspection.js.map +1 -0
- package/build/node_modules/bluebird/js/release/synchronous_inspection.mjs +105 -0
- package/build/node_modules/bluebird/js/release/synchronous_inspection.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/thenables.js +92 -0
- package/build/node_modules/bluebird/js/release/thenables.js.map +1 -0
- package/build/node_modules/bluebird/js/release/thenables.mjs +90 -0
- package/build/node_modules/bluebird/js/release/thenables.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/timers.js +99 -0
- package/build/node_modules/bluebird/js/release/timers.js.map +1 -0
- package/build/node_modules/bluebird/js/release/timers.mjs +97 -0
- package/build/node_modules/bluebird/js/release/timers.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/using.js +233 -0
- package/build/node_modules/bluebird/js/release/using.js.map +1 -0
- package/build/node_modules/bluebird/js/release/using.mjs +231 -0
- package/build/node_modules/bluebird/js/release/using.mjs.map +1 -0
- package/build/node_modules/bluebird/js/release/util.js +380 -0
- package/build/node_modules/bluebird/js/release/util.js.map +1 -0
- package/build/node_modules/bluebird/js/release/util.mjs +378 -0
- package/build/node_modules/bluebird/js/release/util.mjs.map +1 -0
- package/build/node_modules/bson/index.js +51 -0
- package/build/node_modules/bson/index.js.map +1 -0
- package/build/node_modules/bson/index.mjs +49 -0
- package/build/node_modules/bson/index.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/binary.js +401 -0
- package/build/node_modules/bson/lib/bson/binary.js.map +1 -0
- package/build/node_modules/bson/lib/bson/binary.mjs +393 -0
- package/build/node_modules/bson/lib/bson/binary.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/bson.js +422 -0
- package/build/node_modules/bson/lib/bson/bson.js.map +1 -0
- package/build/node_modules/bson/lib/bson/bson.mjs +404 -0
- package/build/node_modules/bson/lib/bson/bson.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/code.js +33 -0
- package/build/node_modules/bson/lib/bson/code.js.map +1 -0
- package/build/node_modules/bson/lib/bson/code.mjs +29 -0
- package/build/node_modules/bson/lib/bson/code.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/db_ref.js +41 -0
- package/build/node_modules/bson/lib/bson/db_ref.js.map +1 -0
- package/build/node_modules/bson/lib/bson/db_ref.mjs +37 -0
- package/build/node_modules/bson/lib/bson/db_ref.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/decimal128.js +826 -0
- package/build/node_modules/bson/lib/bson/decimal128.js.map +1 -0
- package/build/node_modules/bson/lib/bson/decimal128.mjs +822 -0
- package/build/node_modules/bson/lib/bson/decimal128.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/double.js +42 -0
- package/build/node_modules/bson/lib/bson/double.js.map +1 -0
- package/build/node_modules/bson/lib/bson/double.mjs +38 -0
- package/build/node_modules/bson/lib/bson/double.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/float_parser.js +138 -0
- package/build/node_modules/bson/lib/bson/float_parser.js.map +1 -0
- package/build/node_modules/bson/lib/bson/float_parser.mjs +133 -0
- package/build/node_modules/bson/lib/bson/float_parser.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/int_32.js +42 -0
- package/build/node_modules/bson/lib/bson/int_32.js.map +1 -0
- package/build/node_modules/bson/lib/bson/int_32.mjs +38 -0
- package/build/node_modules/bson/lib/bson/int_32.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/long.js +874 -0
- package/build/node_modules/bson/lib/bson/long.js.map +1 -0
- package/build/node_modules/bson/lib/bson/long.mjs +870 -0
- package/build/node_modules/bson/lib/bson/long.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/map.js +136 -0
- package/build/node_modules/bson/lib/bson/map.js.map +1 -0
- package/build/node_modules/bson/lib/bson/map.mjs +134 -0
- package/build/node_modules/bson/lib/bson/map.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/max_key.js +23 -0
- package/build/node_modules/bson/lib/bson/max_key.js.map +1 -0
- package/build/node_modules/bson/lib/bson/max_key.mjs +19 -0
- package/build/node_modules/bson/lib/bson/max_key.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/min_key.js +23 -0
- package/build/node_modules/bson/lib/bson/min_key.js.map +1 -0
- package/build/node_modules/bson/lib/bson/min_key.mjs +19 -0
- package/build/node_modules/bson/lib/bson/min_key.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/objectid.js +410 -0
- package/build/node_modules/bson/lib/bson/objectid.js.map +1 -0
- package/build/node_modules/bson/lib/bson/objectid.mjs +401 -0
- package/build/node_modules/bson/lib/bson/objectid.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/calculate_size.js +271 -0
- package/build/node_modules/bson/lib/bson/parser/calculate_size.js.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/calculate_size.mjs +269 -0
- package/build/node_modules/bson/lib/bson/parser/calculate_size.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/deserializer.js +798 -0
- package/build/node_modules/bson/lib/bson/parser/deserializer.js.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/deserializer.mjs +796 -0
- package/build/node_modules/bson/lib/bson/parser/deserializer.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/serializer.js +1200 -0
- package/build/node_modules/bson/lib/bson/parser/serializer.js.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/serializer.mjs +1198 -0
- package/build/node_modules/bson/lib/bson/parser/serializer.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/utils.js +30 -0
- package/build/node_modules/bson/lib/bson/parser/utils.js.map +1 -0
- package/build/node_modules/bson/lib/bson/parser/utils.mjs +28 -0
- package/build/node_modules/bson/lib/bson/parser/utils.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/regexp.js +42 -0
- package/build/node_modules/bson/lib/bson/regexp.js.map +1 -0
- package/build/node_modules/bson/lib/bson/regexp.mjs +38 -0
- package/build/node_modules/bson/lib/bson/regexp.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/symbol.js +65 -0
- package/build/node_modules/bson/lib/bson/symbol.js.map +1 -0
- package/build/node_modules/bson/lib/bson/symbol.mjs +57 -0
- package/build/node_modules/bson/lib/bson/symbol.mjs.map +1 -0
- package/build/node_modules/bson/lib/bson/timestamp.js +863 -0
- package/build/node_modules/bson/lib/bson/timestamp.js.map +1 -0
- package/build/node_modules/bson/lib/bson/timestamp.mjs +859 -0
- package/build/node_modules/bson/lib/bson/timestamp.mjs.map +1 -0
- package/build/node_modules/core-util-is/lib/util.js +147 -0
- package/build/node_modules/core-util-is/lib/util.js.map +1 -0
- package/build/node_modules/core-util-is/lib/util.mjs +129 -0
- package/build/node_modules/core-util-is/lib/util.mjs.map +1 -0
- package/build/node_modules/denque/index.js +446 -0
- package/build/node_modules/denque/index.js.map +1 -0
- package/build/node_modules/denque/index.mjs +444 -0
- package/build/node_modules/denque/index.mjs.map +1 -0
- package/build/node_modules/double-ended-queue/js/deque.js +279 -0
- package/build/node_modules/double-ended-queue/js/deque.js.map +1 -0
- package/build/node_modules/double-ended-queue/js/deque.mjs +277 -0
- package/build/node_modules/double-ended-queue/js/deque.mjs.map +1 -0
- package/build/node_modules/inherits/inherits.js +24 -0
- package/build/node_modules/inherits/inherits.js.map +1 -0
- package/build/node_modules/inherits/inherits.mjs +18 -0
- package/build/node_modules/inherits/inherits.mjs.map +1 -0
- package/build/node_modules/inherits/inherits_browser.js +36 -0
- package/build/node_modules/inherits/inherits_browser.js.map +1 -0
- package/build/node_modules/inherits/inherits_browser.mjs +34 -0
- package/build/node_modules/inherits/inherits_browser.mjs.map +1 -0
- package/build/node_modules/isarray/index.js +10 -0
- package/build/node_modules/isarray/index.js.map +1 -0
- package/build/node_modules/isarray/index.mjs +8 -0
- package/build/node_modules/isarray/index.mjs.map +1 -0
- package/build/node_modules/kareem/index.js +514 -0
- package/build/node_modules/kareem/index.js.map +1 -0
- package/build/node_modules/kareem/index.mjs +512 -0
- package/build/node_modules/kareem/index.mjs.map +1 -0
- package/build/node_modules/memory-pager/index.js +165 -0
- package/build/node_modules/memory-pager/index.js.map +1 -0
- package/build/node_modules/memory-pager/index.mjs +163 -0
- package/build/node_modules/memory-pager/index.mjs.map +1 -0
- package/build/node_modules/mongodb/index.js +93 -0
- package/build/node_modules/mongodb/index.js.map +1 -0
- package/build/node_modules/mongodb/index.mjs +91 -0
- package/build/node_modules/mongodb/index.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/admin.js +307 -0
- package/build/node_modules/mongodb/lib/admin.js.map +1 -0
- package/build/node_modules/mongodb/lib/admin.mjs +305 -0
- package/build/node_modules/mongodb/lib/admin.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/aggregation_cursor.js +376 -0
- package/build/node_modules/mongodb/lib/aggregation_cursor.js.map +1 -0
- package/build/node_modules/mongodb/lib/aggregation_cursor.mjs +374 -0
- package/build/node_modules/mongodb/lib/aggregation_cursor.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/apm.js +41 -0
- package/build/node_modules/mongodb/lib/apm.js.map +1 -0
- package/build/node_modules/mongodb/lib/apm.mjs +35 -0
- package/build/node_modules/mongodb/lib/apm.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/async/async_iterator.js +43 -0
- package/build/node_modules/mongodb/lib/async/async_iterator.js.map +1 -0
- package/build/node_modules/mongodb/lib/async/async_iterator.mjs +39 -0
- package/build/node_modules/mongodb/lib/async/async_iterator.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/bulk/common.js +1381 -0
- package/build/node_modules/mongodb/lib/bulk/common.js.map +1 -0
- package/build/node_modules/mongodb/lib/bulk/common.mjs +1379 -0
- package/build/node_modules/mongodb/lib/bulk/common.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/bulk/ordered.js +119 -0
- package/build/node_modules/mongodb/lib/bulk/ordered.js.map +1 -0
- package/build/node_modules/mongodb/lib/bulk/ordered.mjs +115 -0
- package/build/node_modules/mongodb/lib/bulk/ordered.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/bulk/unordered.js +140 -0
- package/build/node_modules/mongodb/lib/bulk/unordered.js.map +1 -0
- package/build/node_modules/mongodb/lib/bulk/unordered.mjs +136 -0
- package/build/node_modules/mongodb/lib/bulk/unordered.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/change_stream.js +640 -0
- package/build/node_modules/mongodb/lib/change_stream.js.map +1 -0
- package/build/node_modules/mongodb/lib/change_stream.mjs +634 -0
- package/build/node_modules/mongodb/lib/change_stream.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/connection.js +404 -0
- package/build/node_modules/mongodb/lib/cmap/connection.js.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/connection.mjs +398 -0
- package/build/node_modules/mongodb/lib/cmap/connection.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/connection_pool.js +608 -0
- package/build/node_modules/mongodb/lib/cmap/connection_pool.js.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/connection_pool.mjs +602 -0
- package/build/node_modules/mongodb/lib/cmap/connection_pool.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/errors.js +41 -0
- package/build/node_modules/mongodb/lib/cmap/errors.js.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/errors.mjs +39 -0
- package/build/node_modules/mongodb/lib/cmap/errors.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/events.js +157 -0
- package/build/node_modules/mongodb/lib/cmap/events.js.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/events.mjs +155 -0
- package/build/node_modules/mongodb/lib/cmap/events.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/message_stream.js +211 -0
- package/build/node_modules/mongodb/lib/cmap/message_stream.js.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/message_stream.mjs +205 -0
- package/build/node_modules/mongodb/lib/cmap/message_stream.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/stream_description.js +51 -0
- package/build/node_modules/mongodb/lib/cmap/stream_description.js.map +1 -0
- package/build/node_modules/mongodb/lib/cmap/stream_description.mjs +49 -0
- package/build/node_modules/mongodb/lib/cmap/stream_description.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/collection.js +2294 -0
- package/build/node_modules/mongodb/lib/collection.js.map +1 -0
- package/build/node_modules/mongodb/lib/collection.mjs +2288 -0
- package/build/node_modules/mongodb/lib/collection.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/command_cursor.js +276 -0
- package/build/node_modules/mongodb/lib/command_cursor.js.map +1 -0
- package/build/node_modules/mongodb/lib/command_cursor.mjs +274 -0
- package/build/node_modules/mongodb/lib/command_cursor.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/constants.js +13 -0
- package/build/node_modules/mongodb/lib/constants.js.map +1 -0
- package/build/node_modules/mongodb/lib/constants.mjs +11 -0
- package/build/node_modules/mongodb/lib/constants.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/auth_provider.js +58 -0
- package/build/node_modules/mongodb/lib/core/auth/auth_provider.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/auth_provider.mjs +56 -0
- package/build/node_modules/mongodb/lib/core/auth/auth_provider.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/defaultAuthProviders.js +35 -0
- package/build/node_modules/mongodb/lib/core/auth/defaultAuthProviders.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/defaultAuthProviders.mjs +33 -0
- package/build/node_modules/mongodb/lib/core/auth/defaultAuthProviders.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/gssapi.js +162 -0
- package/build/node_modules/mongodb/lib/core/auth/gssapi.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/gssapi.mjs +156 -0
- package/build/node_modules/mongodb/lib/core/auth/gssapi.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/mongo_credentials.js +110 -0
- package/build/node_modules/mongodb/lib/core/auth/mongo_credentials.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/mongo_credentials.mjs +108 -0
- package/build/node_modules/mongodb/lib/core/auth/mongo_credentials.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/mongocr.js +54 -0
- package/build/node_modules/mongodb/lib/core/auth/mongocr.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/mongocr.mjs +48 -0
- package/build/node_modules/mongodb/lib/core/auth/mongocr.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/mongodb_aws.js +275 -0
- package/build/node_modules/mongodb/lib/core/auth/mongodb_aws.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/mongodb_aws.mjs +267 -0
- package/build/node_modules/mongodb/lib/core/auth/mongodb_aws.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/plain.js +35 -0
- package/build/node_modules/mongodb/lib/core/auth/plain.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/plain.mjs +33 -0
- package/build/node_modules/mongodb/lib/core/auth/plain.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/scram.js +362 -0
- package/build/node_modules/mongodb/lib/core/auth/scram.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/scram.mjs +356 -0
- package/build/node_modules/mongodb/lib/core/auth/scram.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/x509.js +41 -0
- package/build/node_modules/mongodb/lib/core/auth/x509.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/auth/x509.mjs +39 -0
- package/build/node_modules/mongodb/lib/core/auth/x509.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/apm.js +259 -0
- package/build/node_modules/mongodb/lib/core/connection/apm.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/apm.mjs +257 -0
- package/build/node_modules/mongodb/lib/core/connection/apm.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/command_result.js +39 -0
- package/build/node_modules/mongodb/lib/core/connection/command_result.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/command_result.mjs +37 -0
- package/build/node_modules/mongodb/lib/core/connection/command_result.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/commands.js +514 -0
- package/build/node_modules/mongodb/lib/core/connection/commands.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/commands.mjs +512 -0
- package/build/node_modules/mongodb/lib/core/connection/commands.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/connect.js +367 -0
- package/build/node_modules/mongodb/lib/core/connection/connect.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/connect.mjs +360 -0
- package/build/node_modules/mongodb/lib/core/connection/connect.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/connection.js +731 -0
- package/build/node_modules/mongodb/lib/core/connection/connection.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/connection.mjs +724 -0
- package/build/node_modules/mongodb/lib/core/connection/connection.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/logger.js +262 -0
- package/build/node_modules/mongodb/lib/core/connection/logger.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/logger.mjs +256 -0
- package/build/node_modules/mongodb/lib/core/connection/logger.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/msg.js +232 -0
- package/build/node_modules/mongodb/lib/core/connection/msg.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/msg.mjs +230 -0
- package/build/node_modules/mongodb/lib/core/connection/msg.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/pool.js +1304 -0
- package/build/node_modules/mongodb/lib/core/connection/pool.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/pool.mjs +1297 -0
- package/build/node_modules/mongodb/lib/core/connection/pool.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/utils.js +59 -0
- package/build/node_modules/mongodb/lib/core/connection/utils.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/connection/utils.mjs +57 -0
- package/build/node_modules/mongodb/lib/core/connection/utils.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/cursor.js +891 -0
- package/build/node_modules/mongodb/lib/core/cursor.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/cursor.mjs +885 -0
- package/build/node_modules/mongodb/lib/core/cursor.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/error.js +354 -0
- package/build/node_modules/mongodb/lib/core/error.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/error.mjs +352 -0
- package/build/node_modules/mongodb/lib/core/error.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/index.js +77 -0
- package/build/node_modules/mongodb/lib/core/index.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/index.mjs +75 -0
- package/build/node_modules/mongodb/lib/core/index.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/common.js +70 -0
- package/build/node_modules/mongodb/lib/core/sdam/common.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/common.mjs +68 -0
- package/build/node_modules/mongodb/lib/core/sdam/common.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/events.js +127 -0
- package/build/node_modules/mongodb/lib/core/sdam/events.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/events.mjs +125 -0
- package/build/node_modules/mongodb/lib/core/sdam/events.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/monitor.js +430 -0
- package/build/node_modules/mongodb/lib/core/sdam/monitor.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/monitor.mjs +424 -0
- package/build/node_modules/mongodb/lib/core/sdam/monitor.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/server.js +584 -0
- package/build/node_modules/mongodb/lib/core/sdam/server.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/server.mjs +578 -0
- package/build/node_modules/mongodb/lib/core/sdam/server.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_description.js +234 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_description.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_description.mjs +232 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_description.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_selection.js +246 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_selection.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_selection.mjs +244 -0
- package/build/node_modules/mongodb/lib/core/sdam/server_selection.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/srv_polling.js +155 -0
- package/build/node_modules/mongodb/lib/core/sdam/srv_polling.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/srv_polling.mjs +145 -0
- package/build/node_modules/mongodb/lib/core/sdam/srv_polling.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology.js +1170 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology.mjs +1163 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology_description.js +468 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology_description.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology_description.mjs +466 -0
- package/build/node_modules/mongodb/lib/core/sdam/topology_description.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/sessions.js +797 -0
- package/build/node_modules/mongodb/lib/core/sessions.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/sessions.mjs +791 -0
- package/build/node_modules/mongodb/lib/core/sessions.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/mongos.js +1415 -0
- package/build/node_modules/mongodb/lib/core/topologies/mongos.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/mongos.mjs +1408 -0
- package/build/node_modules/mongodb/lib/core/topologies/mongos.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/read_preference.js +273 -0
- package/build/node_modules/mongodb/lib/core/topologies/read_preference.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/read_preference.mjs +271 -0
- package/build/node_modules/mongodb/lib/core/topologies/read_preference.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset.js +1586 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset.mjs +1579 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset_state.js +1135 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset_state.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset_state.mjs +1128 -0
- package/build/node_modules/mongodb/lib/core/topologies/replset_state.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/server.js +1006 -0
- package/build/node_modules/mongodb/lib/core/topologies/server.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/server.mjs +999 -0
- package/build/node_modules/mongodb/lib/core/topologies/server.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/shared.js +464 -0
- package/build/node_modules/mongodb/lib/core/topologies/shared.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/topologies/shared.mjs +462 -0
- package/build/node_modules/mongodb/lib/core/topologies/shared.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/transactions.js +188 -0
- package/build/node_modules/mongodb/lib/core/transactions.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/transactions.mjs +186 -0
- package/build/node_modules/mongodb/lib/core/transactions.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/uri_parser.js +745 -0
- package/build/node_modules/mongodb/lib/core/uri_parser.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/uri_parser.mjs +737 -0
- package/build/node_modules/mongodb/lib/core/uri_parser.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/utils.js +307 -0
- package/build/node_modules/mongodb/lib/core/utils.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/utils.mjs +300 -0
- package/build/node_modules/mongodb/lib/core/utils.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/command.js +193 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/command.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/command.mjs +191 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/command.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/compression.js +83 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/compression.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/compression.mjs +77 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/compression.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/constants.js +16 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/constants.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/constants.mjs +14 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/constants.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/get_more.js +105 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/get_more.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/get_more.mjs +103 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/get_more.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/index.js +26 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/index.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/index.mjs +24 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/index.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/kill_cursors.js +80 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/kill_cursors.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/kill_cursors.mjs +78 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/kill_cursors.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/query.js +247 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/query.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/query.mjs +245 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/query.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/shared.js +122 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/shared.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/shared.mjs +120 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/shared.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/write_command.js +68 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/write_command.js.map +1 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/write_command.mjs +66 -0
- package/build/node_modules/mongodb/lib/core/wireprotocol/write_command.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/cursor.js +1156 -0
- package/build/node_modules/mongodb/lib/cursor.js.map +1 -0
- package/build/node_modules/mongodb/lib/cursor.mjs +1149 -0
- package/build/node_modules/mongodb/lib/cursor.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/db.js +1092 -0
- package/build/node_modules/mongodb/lib/db.js.map +1 -0
- package/build/node_modules/mongodb/lib/db.mjs +1085 -0
- package/build/node_modules/mongodb/lib/db.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/dynamic_loaders.js +39 -0
- package/build/node_modules/mongodb/lib/dynamic_loaders.js.map +1 -0
- package/build/node_modules/mongodb/lib/dynamic_loaders.mjs +37 -0
- package/build/node_modules/mongodb/lib/dynamic_loaders.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/encrypter.js +176 -0
- package/build/node_modules/mongodb/lib/encrypter.js.map +1 -0
- package/build/node_modules/mongodb/lib/encrypter.mjs +170 -0
- package/build/node_modules/mongodb/lib/encrypter.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/error.js +48 -0
- package/build/node_modules/mongodb/lib/error.js.map +1 -0
- package/build/node_modules/mongodb/lib/error.mjs +46 -0
- package/build/node_modules/mongodb/lib/error.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/explain.js +60 -0
- package/build/node_modules/mongodb/lib/explain.js.map +1 -0
- package/build/node_modules/mongodb/lib/explain.mjs +58 -0
- package/build/node_modules/mongodb/lib/explain.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs/chunk.js +242 -0
- package/build/node_modules/mongodb/lib/gridfs/chunk.js.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs/chunk.mjs +240 -0
- package/build/node_modules/mongodb/lib/gridfs/chunk.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs/grid_store.js +1940 -0
- package/build/node_modules/mongodb/lib/gridfs/grid_store.js.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs/grid_store.mjs +1932 -0
- package/build/node_modules/mongodb/lib/gridfs/grid_store.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/download.js +441 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/download.js.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/download.mjs +434 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/download.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/index.js +366 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/index.js.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/index.mjs +359 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/index.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/upload.js +552 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/upload.js.map +1 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/upload.mjs +544 -0
- package/build/node_modules/mongodb/lib/gridfs-stream/upload.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/mongo_client.js +514 -0
- package/build/node_modules/mongodb/lib/mongo_client.js.map +1 -0
- package/build/node_modules/mongodb/lib/mongo_client.mjs +507 -0
- package/build/node_modules/mongodb/lib/mongo_client.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/add_user.js +111 -0
- package/build/node_modules/mongodb/lib/operations/add_user.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/add_user.mjs +105 -0
- package/build/node_modules/mongodb/lib/operations/add_user.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/aggregate.js +111 -0
- package/build/node_modules/mongodb/lib/operations/aggregate.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/aggregate.mjs +109 -0
- package/build/node_modules/mongodb/lib/operations/aggregate.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/bulk_write.js +103 -0
- package/build/node_modules/mongodb/lib/operations/bulk_write.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/bulk_write.mjs +101 -0
- package/build/node_modules/mongodb/lib/operations/bulk_write.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/collection_ops.js +361 -0
- package/build/node_modules/mongodb/lib/operations/collection_ops.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/collection_ops.mjs +359 -0
- package/build/node_modules/mongodb/lib/operations/collection_ops.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/collections.js +62 -0
- package/build/node_modules/mongodb/lib/operations/collections.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/collections.mjs +60 -0
- package/build/node_modules/mongodb/lib/operations/collections.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/command.js +126 -0
- package/build/node_modules/mongodb/lib/operations/command.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/command.mjs +124 -0
- package/build/node_modules/mongodb/lib/operations/command.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/command_v2.js +131 -0
- package/build/node_modules/mongodb/lib/operations/command_v2.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/command_v2.mjs +129 -0
- package/build/node_modules/mongodb/lib/operations/command_v2.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/common_functions.js +408 -0
- package/build/node_modules/mongodb/lib/operations/common_functions.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/common_functions.mjs +406 -0
- package/build/node_modules/mongodb/lib/operations/common_functions.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/connect.js +805 -0
- package/build/node_modules/mongodb/lib/operations/connect.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/connect.mjs +798 -0
- package/build/node_modules/mongodb/lib/operations/connect.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/count.js +74 -0
- package/build/node_modules/mongodb/lib/operations/count.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/count.mjs +72 -0
- package/build/node_modules/mongodb/lib/operations/count.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/count_documents.js +44 -0
- package/build/node_modules/mongodb/lib/operations/count_documents.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/count_documents.mjs +42 -0
- package/build/node_modules/mongodb/lib/operations/count_documents.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/create_collection.js +111 -0
- package/build/node_modules/mongodb/lib/operations/create_collection.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/create_collection.mjs +109 -0
- package/build/node_modules/mongodb/lib/operations/create_collection.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/create_indexes.js +146 -0
- package/build/node_modules/mongodb/lib/operations/create_indexes.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/create_indexes.mjs +144 -0
- package/build/node_modules/mongodb/lib/operations/create_indexes.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/cursor_ops.js +175 -0
- package/build/node_modules/mongodb/lib/operations/cursor_ops.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/cursor_ops.mjs +173 -0
- package/build/node_modules/mongodb/lib/operations/cursor_ops.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/db_ops.js +474 -0
- package/build/node_modules/mongodb/lib/operations/db_ops.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/db_ops.mjs +472 -0
- package/build/node_modules/mongodb/lib/operations/db_ops.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/delete_many.js +44 -0
- package/build/node_modules/mongodb/lib/operations/delete_many.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/delete_many.mjs +42 -0
- package/build/node_modules/mongodb/lib/operations/delete_many.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/delete_one.js +44 -0
- package/build/node_modules/mongodb/lib/operations/delete_one.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/delete_one.mjs +42 -0
- package/build/node_modules/mongodb/lib/operations/delete_one.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/distinct.js +102 -0
- package/build/node_modules/mongodb/lib/operations/distinct.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/distinct.mjs +100 -0
- package/build/node_modules/mongodb/lib/operations/distinct.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/drop.js +60 -0
- package/build/node_modules/mongodb/lib/operations/drop.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/drop.mjs +58 -0
- package/build/node_modules/mongodb/lib/operations/drop.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/drop_index.js +49 -0
- package/build/node_modules/mongodb/lib/operations/drop_index.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/drop_index.mjs +47 -0
- package/build/node_modules/mongodb/lib/operations/drop_index.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/drop_indexes.js +30 -0
- package/build/node_modules/mongodb/lib/operations/drop_indexes.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/drop_indexes.mjs +28 -0
- package/build/node_modules/mongodb/lib/operations/drop_indexes.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/estimated_document_count.js +64 -0
- package/build/node_modules/mongodb/lib/operations/estimated_document_count.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/estimated_document_count.mjs +62 -0
- package/build/node_modules/mongodb/lib/operations/estimated_document_count.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/execute_db_admin_command.js +41 -0
- package/build/node_modules/mongodb/lib/operations/execute_db_admin_command.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/execute_db_admin_command.mjs +39 -0
- package/build/node_modules/mongodb/lib/operations/execute_db_admin_command.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/execute_operation.js +173 -0
- package/build/node_modules/mongodb/lib/operations/execute_operation.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/execute_operation.mjs +171 -0
- package/build/node_modules/mongodb/lib/operations/execute_operation.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find.js +57 -0
- package/build/node_modules/mongodb/lib/operations/find.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find.mjs +55 -0
- package/build/node_modules/mongodb/lib/operations/find.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_and_modify.js +138 -0
- package/build/node_modules/mongodb/lib/operations/find_and_modify.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_and_modify.mjs +136 -0
- package/build/node_modules/mongodb/lib/operations/find_and_modify.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one.js +47 -0
- package/build/node_modules/mongodb/lib/operations/find_one.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one.mjs +45 -0
- package/build/node_modules/mongodb/lib/operations/find_one.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_delete.js +24 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_delete.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_delete.mjs +22 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_delete.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_replace.js +44 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_replace.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_replace.mjs +42 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_replace.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_update.js +44 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_update.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_update.mjs +42 -0
- package/build/node_modules/mongodb/lib/operations/find_one_and_update.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/geo_haystack_search.js +87 -0
- package/build/node_modules/mongodb/lib/operations/geo_haystack_search.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/geo_haystack_search.mjs +85 -0
- package/build/node_modules/mongodb/lib/operations/geo_haystack_search.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/index_exists.js +46 -0
- package/build/node_modules/mongodb/lib/operations/index_exists.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/index_exists.mjs +44 -0
- package/build/node_modules/mongodb/lib/operations/index_exists.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/index_information.js +29 -0
- package/build/node_modules/mongodb/lib/operations/index_information.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/index_information.mjs +27 -0
- package/build/node_modules/mongodb/lib/operations/index_information.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/indexes.js +28 -0
- package/build/node_modules/mongodb/lib/operations/indexes.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/indexes.mjs +26 -0
- package/build/node_modules/mongodb/lib/operations/indexes.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/insert_many.js +67 -0
- package/build/node_modules/mongodb/lib/operations/insert_many.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/insert_many.mjs +65 -0
- package/build/node_modules/mongodb/lib/operations/insert_many.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/insert_one.js +46 -0
- package/build/node_modules/mongodb/lib/operations/insert_one.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/insert_one.mjs +44 -0
- package/build/node_modules/mongodb/lib/operations/insert_one.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/is_capped.js +24 -0
- package/build/node_modules/mongodb/lib/operations/is_capped.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/is_capped.mjs +22 -0
- package/build/node_modules/mongodb/lib/operations/is_capped.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/list_collections.js +113 -0
- package/build/node_modules/mongodb/lib/operations/list_collections.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/list_collections.mjs +111 -0
- package/build/node_modules/mongodb/lib/operations/list_collections.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/list_databases.js +44 -0
- package/build/node_modules/mongodb/lib/operations/list_databases.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/list_databases.mjs +42 -0
- package/build/node_modules/mongodb/lib/operations/list_databases.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/list_indexes.js +48 -0
- package/build/node_modules/mongodb/lib/operations/list_indexes.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/list_indexes.mjs +46 -0
- package/build/node_modules/mongodb/lib/operations/list_indexes.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/map_reduce.js +220 -0
- package/build/node_modules/mongodb/lib/operations/map_reduce.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/map_reduce.mjs +218 -0
- package/build/node_modules/mongodb/lib/operations/map_reduce.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/operation.js +82 -0
- package/build/node_modules/mongodb/lib/operations/operation.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/operation.mjs +80 -0
- package/build/node_modules/mongodb/lib/operations/operation.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/options_operation.js +39 -0
- package/build/node_modules/mongodb/lib/operations/options_operation.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/options_operation.mjs +37 -0
- package/build/node_modules/mongodb/lib/operations/options_operation.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/profiling_level.js +34 -0
- package/build/node_modules/mongodb/lib/operations/profiling_level.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/profiling_level.mjs +32 -0
- package/build/node_modules/mongodb/lib/operations/profiling_level.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/re_index.js +41 -0
- package/build/node_modules/mongodb/lib/operations/re_index.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/re_index.mjs +39 -0
- package/build/node_modules/mongodb/lib/operations/re_index.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/remove_user.js +60 -0
- package/build/node_modules/mongodb/lib/operations/remove_user.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/remove_user.mjs +58 -0
- package/build/node_modules/mongodb/lib/operations/remove_user.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/rename.js +69 -0
- package/build/node_modules/mongodb/lib/operations/rename.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/rename.mjs +67 -0
- package/build/node_modules/mongodb/lib/operations/rename.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/replace_one.js +61 -0
- package/build/node_modules/mongodb/lib/operations/replace_one.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/replace_one.mjs +59 -0
- package/build/node_modules/mongodb/lib/operations/replace_one.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/run_command.js +24 -0
- package/build/node_modules/mongodb/lib/operations/run_command.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/run_command.mjs +22 -0
- package/build/node_modules/mongodb/lib/operations/run_command.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/set_profiling_level.js +52 -0
- package/build/node_modules/mongodb/lib/operations/set_profiling_level.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/set_profiling_level.mjs +50 -0
- package/build/node_modules/mongodb/lib/operations/set_profiling_level.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/stats.js +51 -0
- package/build/node_modules/mongodb/lib/operations/stats.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/stats.mjs +49 -0
- package/build/node_modules/mongodb/lib/operations/stats.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/update_many.js +62 -0
- package/build/node_modules/mongodb/lib/operations/update_many.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/update_many.mjs +60 -0
- package/build/node_modules/mongodb/lib/operations/update_many.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/update_one.js +62 -0
- package/build/node_modules/mongodb/lib/operations/update_one.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/update_one.mjs +60 -0
- package/build/node_modules/mongodb/lib/operations/update_one.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/operations/validate_collection.js +42 -0
- package/build/node_modules/mongodb/lib/operations/validate_collection.js.map +1 -0
- package/build/node_modules/mongodb/lib/operations/validate_collection.mjs +40 -0
- package/build/node_modules/mongodb/lib/operations/validate_collection.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/read_concern.js +64 -0
- package/build/node_modules/mongodb/lib/read_concern.js.map +1 -0
- package/build/node_modules/mongodb/lib/read_concern.mjs +62 -0
- package/build/node_modules/mongodb/lib/read_concern.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/mongos.js +454 -0
- package/build/node_modules/mongodb/lib/topologies/mongos.js.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/mongos.mjs +452 -0
- package/build/node_modules/mongodb/lib/topologies/mongos.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/native_topology.js +86 -0
- package/build/node_modules/mongodb/lib/topologies/native_topology.js.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/native_topology.mjs +84 -0
- package/build/node_modules/mongodb/lib/topologies/native_topology.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/replset.js +496 -0
- package/build/node_modules/mongodb/lib/topologies/replset.js.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/replset.mjs +494 -0
- package/build/node_modules/mongodb/lib/topologies/replset.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/server.js +456 -0
- package/build/node_modules/mongodb/lib/topologies/server.js.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/server.mjs +454 -0
- package/build/node_modules/mongodb/lib/topologies/server.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/topology_base.js +439 -0
- package/build/node_modules/mongodb/lib/topologies/topology_base.js.map +1 -0
- package/build/node_modules/mongodb/lib/topologies/topology_base.mjs +428 -0
- package/build/node_modules/mongodb/lib/topologies/topology_base.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/url_parser.js +646 -0
- package/build/node_modules/mongodb/lib/url_parser.js.map +1 -0
- package/build/node_modules/mongodb/lib/url_parser.mjs +637 -0
- package/build/node_modules/mongodb/lib/url_parser.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/utils.js +919 -0
- package/build/node_modules/mongodb/lib/utils.js.map +1 -0
- package/build/node_modules/mongodb/lib/utils.mjs +917 -0
- package/build/node_modules/mongodb/lib/utils.mjs.map +1 -0
- package/build/node_modules/mongodb/lib/write_concern.js +99 -0
- package/build/node_modules/mongodb/lib/write_concern.js.map +1 -0
- package/build/node_modules/mongodb/lib/write_concern.mjs +97 -0
- package/build/node_modules/mongodb/lib/write_concern.mjs.map +1 -0
- package/build/node_modules/mongodb/package.json.js +146 -0
- package/build/node_modules/mongodb/package.json.js.map +1 -0
- package/build/node_modules/mongodb/package.mjs +127 -0
- package/build/node_modules/mongodb/package.mjs.map +1 -0
- package/build/node_modules/mongoose/index.js +8 -0
- package/build/node_modules/mongoose/index.js.map +1 -0
- package/build/node_modules/mongoose/index.mjs +6 -0
- package/build/node_modules/mongoose/index.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/aggregate.js +1176 -0
- package/build/node_modules/mongoose/lib/aggregate.js.map +1 -0
- package/build/node_modules/mongoose/lib/aggregate.mjs +1170 -0
- package/build/node_modules/mongoose/lib/aggregate.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/browserDocument.js +119 -0
- package/build/node_modules/mongoose/lib/browserDocument.js.map +1 -0
- package/build/node_modules/mongoose/lib/browserDocument.mjs +113 -0
- package/build/node_modules/mongoose/lib/browserDocument.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cast/boolean.js +41 -0
- package/build/node_modules/mongoose/lib/cast/boolean.js.map +1 -0
- package/build/node_modules/mongoose/lib/cast/boolean.mjs +39 -0
- package/build/node_modules/mongoose/lib/cast/boolean.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cast/date.js +48 -0
- package/build/node_modules/mongoose/lib/cast/date.js.map +1 -0
- package/build/node_modules/mongoose/lib/cast/date.mjs +42 -0
- package/build/node_modules/mongoose/lib/cast/date.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cast/decimal128.js +43 -0
- package/build/node_modules/mongoose/lib/cast/decimal128.js.map +1 -0
- package/build/node_modules/mongoose/lib/cast/decimal128.mjs +37 -0
- package/build/node_modules/mongoose/lib/cast/decimal128.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cast/number.js +50 -0
- package/build/node_modules/mongoose/lib/cast/number.js.map +1 -0
- package/build/node_modules/mongoose/lib/cast/number.mjs +44 -0
- package/build/node_modules/mongoose/lib/cast/number.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cast/objectid.js +39 -0
- package/build/node_modules/mongoose/lib/cast/objectid.js.map +1 -0
- package/build/node_modules/mongoose/lib/cast/objectid.mjs +33 -0
- package/build/node_modules/mongoose/lib/cast/objectid.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cast/string.js +40 -0
- package/build/node_modules/mongoose/lib/cast/string.js.map +1 -0
- package/build/node_modules/mongoose/lib/cast/string.mjs +38 -0
- package/build/node_modules/mongoose/lib/cast/string.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cast.js +382 -0
- package/build/node_modules/mongoose/lib/cast.js.map +1 -0
- package/build/node_modules/mongoose/lib/cast.mjs +376 -0
- package/build/node_modules/mongoose/lib/cast.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/collection.js +333 -0
- package/build/node_modules/mongoose/lib/collection.js.map +1 -0
- package/build/node_modules/mongoose/lib/collection.mjs +327 -0
- package/build/node_modules/mongoose/lib/collection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/connection.js +1534 -0
- package/build/node_modules/mongoose/lib/connection.js.map +1 -0
- package/build/node_modules/mongoose/lib/connection.mjs +1528 -0
- package/build/node_modules/mongoose/lib/connection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/connectionstate.js +29 -0
- package/build/node_modules/mongoose/lib/connectionstate.js.map +1 -0
- package/build/node_modules/mongoose/lib/connectionstate.mjs +27 -0
- package/build/node_modules/mongoose/lib/connectionstate.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cursor/AggregationCursor.js +384 -0
- package/build/node_modules/mongoose/lib/cursor/AggregationCursor.js.map +1 -0
- package/build/node_modules/mongoose/lib/cursor/AggregationCursor.mjs +377 -0
- package/build/node_modules/mongoose/lib/cursor/AggregationCursor.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cursor/ChangeStream.js +70 -0
- package/build/node_modules/mongoose/lib/cursor/ChangeStream.js.map +1 -0
- package/build/node_modules/mongoose/lib/cursor/ChangeStream.mjs +64 -0
- package/build/node_modules/mongoose/lib/cursor/ChangeStream.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/cursor/QueryCursor.js +522 -0
- package/build/node_modules/mongoose/lib/cursor/QueryCursor.js.map +1 -0
- package/build/node_modules/mongoose/lib/cursor/QueryCursor.mjs +515 -0
- package/build/node_modules/mongoose/lib/cursor/QueryCursor.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/document.js +4305 -0
- package/build/node_modules/mongoose/lib/document.js.map +1 -0
- package/build/node_modules/mongoose/lib/document.mjs +4298 -0
- package/build/node_modules/mongoose/lib/document.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/document_provider.js +40 -0
- package/build/node_modules/mongoose/lib/document_provider.js.map +1 -0
- package/build/node_modules/mongoose/lib/document_provider.mjs +36 -0
- package/build/node_modules/mongoose/lib/document_provider.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/driver.js +27 -0
- package/build/node_modules/mongoose/lib/driver.js.map +1 -0
- package/build/node_modules/mongoose/lib/driver.mjs +22 -0
- package/build/node_modules/mongoose/lib/driver.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.js +52 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.js.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.mjs +50 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js +14 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.mjs +12 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +470 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.mjs +463 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +219 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.mjs +217 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.js +12 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.js.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.mjs +10 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js +39 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/index.mjs +30 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/index.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js +18 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js.map +1 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.mjs +16 -0
- package/build/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/cast.js +161 -0
- package/build/node_modules/mongoose/lib/error/cast.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/cast.mjs +155 -0
- package/build/node_modules/mongoose/lib/error/cast.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/divergentArray.js +35 -0
- package/build/node_modules/mongoose/lib/error/divergentArray.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/divergentArray.mjs +33 -0
- package/build/node_modules/mongoose/lib/error/divergentArray.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/index.js +225 -0
- package/build/node_modules/mongoose/lib/error/index.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/index.mjs +223 -0
- package/build/node_modules/mongoose/lib/error/index.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/messages.js +32 -0
- package/build/node_modules/mongoose/lib/error/messages.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/messages.mjs +30 -0
- package/build/node_modules/mongoose/lib/error/messages.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/missingSchema.js +28 -0
- package/build/node_modules/mongoose/lib/error/missingSchema.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/missingSchema.mjs +26 -0
- package/build/node_modules/mongoose/lib/error/missingSchema.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/mongooseError.js +16 -0
- package/build/node_modules/mongoose/lib/error/mongooseError.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/mongooseError.mjs +14 -0
- package/build/node_modules/mongoose/lib/error/mongooseError.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/notFound.js +54 -0
- package/build/node_modules/mongoose/lib/error/notFound.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/notFound.mjs +48 -0
- package/build/node_modules/mongoose/lib/error/notFound.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/objectExpected.js +35 -0
- package/build/node_modules/mongoose/lib/error/objectExpected.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/objectExpected.mjs +33 -0
- package/build/node_modules/mongoose/lib/error/objectExpected.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/objectParameter.js +35 -0
- package/build/node_modules/mongoose/lib/error/objectParameter.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/objectParameter.mjs +33 -0
- package/build/node_modules/mongoose/lib/error/objectParameter.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/overwriteModel.js +26 -0
- package/build/node_modules/mongoose/lib/error/overwriteModel.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/overwriteModel.mjs +24 -0
- package/build/node_modules/mongoose/lib/error/overwriteModel.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/parallelSave.js +35 -0
- package/build/node_modules/mongoose/lib/error/parallelSave.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/parallelSave.mjs +33 -0
- package/build/node_modules/mongoose/lib/error/parallelSave.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/parallelValidate.js +36 -0
- package/build/node_modules/mongoose/lib/error/parallelValidate.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/parallelValidate.mjs +34 -0
- package/build/node_modules/mongoose/lib/error/parallelValidate.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/serverSelection.js +69 -0
- package/build/node_modules/mongoose/lib/error/serverSelection.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/serverSelection.mjs +67 -0
- package/build/node_modules/mongoose/lib/error/serverSelection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/strict.js +38 -0
- package/build/node_modules/mongoose/lib/error/strict.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/strict.mjs +36 -0
- package/build/node_modules/mongoose/lib/error/strict.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/validation.js +121 -0
- package/build/node_modules/mongoose/lib/error/validation.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/validation.mjs +115 -0
- package/build/node_modules/mongoose/lib/error/validation.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/validator.js +99 -0
- package/build/node_modules/mongoose/lib/error/validator.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/validator.mjs +97 -0
- package/build/node_modules/mongoose/lib/error/validator.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/error/version.js +41 -0
- package/build/node_modules/mongoose/lib/error/version.js.map +1 -0
- package/build/node_modules/mongoose/lib/error/version.mjs +39 -0
- package/build/node_modules/mongoose/lib/error/version.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js +53 -0
- package/build/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.mjs +51 -0
- package/build/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/arrayDepth.js +36 -0
- package/build/node_modules/mongoose/lib/helpers/arrayDepth.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/arrayDepth.mjs +34 -0
- package/build/node_modules/mongoose/lib/helpers/arrayDepth.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/clone.js +141 -0
- package/build/node_modules/mongoose/lib/helpers/clone.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/clone.mjs +139 -0
- package/build/node_modules/mongoose/lib/helpers/clone.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/common.js +123 -0
- package/build/node_modules/mongoose/lib/helpers/common.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/common.mjs +118 -0
- package/build/node_modules/mongoose/lib/helpers/common.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/cursor/eachAsync.js +163 -0
- package/build/node_modules/mongoose/lib/helpers/cursor/eachAsync.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/cursor/eachAsync.mjs +161 -0
- package/build/node_modules/mongoose/lib/helpers/cursor/eachAsync.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js +19 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.mjs +17 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js +15 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.mjs +13 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +28 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getConstructor.mjs +26 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getConstructor.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +30 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.mjs +28 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +29 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.mjs +27 -0
- package/build/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +31 -0
- package/build/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.mjs +29 -0
- package/build/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/compile.js +229 -0
- package/build/node_modules/mongoose/lib/helpers/document/compile.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/compile.mjs +224 -0
- package/build/node_modules/mongoose/lib/helpers/document/compile.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +46 -0
- package/build/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.mjs +44 -0
- package/build/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js +20 -0
- package/build/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.mjs +18 -0
- package/build/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/each.js +28 -0
- package/build/node_modules/mongoose/lib/helpers/each.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/each.mjs +26 -0
- package/build/node_modules/mongoose/lib/helpers/each.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/get.js +67 -0
- package/build/node_modules/mongoose/lib/helpers/get.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/get.mjs +65 -0
- package/build/node_modules/mongoose/lib/helpers/get.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js +31 -0
- package/build/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.mjs +29 -0
- package/build/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/getFunctionName.js +11 -0
- package/build/node_modules/mongoose/lib/helpers/getFunctionName.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/getFunctionName.mjs +9 -0
- package/build/node_modules/mongoose/lib/helpers/getFunctionName.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/immediate.js +17 -0
- package/build/node_modules/mongoose/lib/helpers/immediate.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/immediate.mjs +15 -0
- package/build/node_modules/mongoose/lib/helpers/immediate.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js +21 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.mjs +19 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +98 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.mjs +96 -0
- package/build/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isBsonType.js +16 -0
- package/build/node_modules/mongoose/lib/helpers/isBsonType.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isBsonType.mjs +14 -0
- package/build/node_modules/mongoose/lib/helpers/isBsonType.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isMongooseObject.js +24 -0
- package/build/node_modules/mongoose/lib/helpers/isMongooseObject.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isMongooseObject.mjs +22 -0
- package/build/node_modules/mongoose/lib/helpers/isMongooseObject.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isObject.js +19 -0
- package/build/node_modules/mongoose/lib/helpers/isObject.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isObject.mjs +17 -0
- package/build/node_modules/mongoose/lib/helpers/isObject.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isPromise.js +10 -0
- package/build/node_modules/mongoose/lib/helpers/isPromise.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/isPromise.mjs +8 -0
- package/build/node_modules/mongoose/lib/helpers/isPromise.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyHooks.js +141 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyHooks.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyHooks.mjs +139 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyHooks.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyMethods.js +59 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyMethods.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyMethods.mjs +57 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyMethods.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +77 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStaticHooks.mjs +75 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStaticHooks.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStatics.js +15 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStatics.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStatics.mjs +13 -0
- package/build/node_modules/mongoose/lib/helpers/model/applyStatics.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/castBulkWrite.js +227 -0
- package/build/node_modules/mongoose/lib/helpers/model/castBulkWrite.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/castBulkWrite.mjs +225 -0
- package/build/node_modules/mongoose/lib/helpers/model/castBulkWrite.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/discriminator.js +212 -0
- package/build/node_modules/mongoose/lib/helpers/model/discriminator.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/model/discriminator.mjs +210 -0
- package/build/node_modules/mongoose/lib/helpers/model/discriminator.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/parallelLimit.js +58 -0
- package/build/node_modules/mongoose/lib/helpers/parallelLimit.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/parallelLimit.mjs +56 -0
- package/build/node_modules/mongoose/lib/helpers/parallelLimit.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/path/parentPaths.js +16 -0
- package/build/node_modules/mongoose/lib/helpers/path/parentPaths.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/path/parentPaths.mjs +14 -0
- package/build/node_modules/mongoose/lib/helpers/path/parentPaths.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/path/setDottedPath.js +19 -0
- package/build/node_modules/mongoose/lib/helpers/path/setDottedPath.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/path/setDottedPath.mjs +17 -0
- package/build/node_modules/mongoose/lib/helpers/path/setDottedPath.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js +13 -0
- package/build/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.mjs +11 -0
- package/build/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +104 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.mjs +102 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignVals.js +291 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignVals.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignVals.mjs +289 -0
- package/build/node_modules/mongoose/lib/helpers/populate/assignVals.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +82 -0
- package/build/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.mjs +80 -0
- package/build/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +550 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.mjs +544 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +218 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.mjs +216 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getVirtual.js +75 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getVirtual.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getVirtual.mjs +73 -0
- package/build/node_modules/mongoose/lib/helpers/populate/getVirtual.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js +10 -0
- package/build/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.mjs +8 -0
- package/build/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js +31 -0
- package/build/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.mjs +29 -0
- package/build/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/normalizeRefPath.js +48 -0
- package/build/node_modules/mongoose/lib/helpers/populate/normalizeRefPath.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/normalizeRefPath.mjs +46 -0
- package/build/node_modules/mongoose/lib/helpers/populate/normalizeRefPath.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js +34 -0
- package/build/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.mjs +32 -0
- package/build/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/validateRef.js +26 -0
- package/build/node_modules/mongoose/lib/helpers/populate/validateRef.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/populate/validateRef.mjs +20 -0
- package/build/node_modules/mongoose/lib/helpers/populate/validateRef.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/printJestWarning.js +16 -0
- package/build/node_modules/mongoose/lib/helpers/printJestWarning.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/printJestWarning.mjs +14 -0
- package/build/node_modules/mongoose/lib/helpers/printJestWarning.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js +21 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.mjs +19 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isExclusive.js +35 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isExclusive.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isExclusive.mjs +33 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isExclusive.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isInclusive.js +37 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isInclusive.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isInclusive.mjs +35 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isInclusive.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +38 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathExcluded.mjs +36 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathExcluded.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js +31 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.mjs +29 -0
- package/build/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/parseProjection.js +36 -0
- package/build/node_modules/mongoose/lib/helpers/projection/parseProjection.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/projection/parseProjection.mjs +34 -0
- package/build/node_modules/mongoose/lib/helpers/projection/parseProjection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/promiseOrCallback.js +49 -0
- package/build/node_modules/mongoose/lib/helpers/promiseOrCallback.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/promiseOrCallback.mjs +47 -0
- package/build/node_modules/mongoose/lib/helpers/promiseOrCallback.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyGlobalMaxTimeMS.js +18 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyGlobalMaxTimeMS.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyGlobalMaxTimeMS.mjs +16 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyGlobalMaxTimeMS.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js +96 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.mjs +94 -0
- package/build/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/castFilterPath.js +58 -0
- package/build/node_modules/mongoose/lib/helpers/query/castFilterPath.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/castFilterPath.mjs +56 -0
- package/build/node_modules/mongoose/lib/helpers/query/castFilterPath.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/castUpdate.js +561 -0
- package/build/node_modules/mongoose/lib/helpers/query/castUpdate.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/castUpdate.mjs +559 -0
- package/build/node_modules/mongoose/lib/helpers/query/castUpdate.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/completeMany.js +54 -0
- package/build/node_modules/mongoose/lib/helpers/query/completeMany.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/completeMany.mjs +52 -0
- package/build/node_modules/mongoose/lib/helpers/query/completeMany.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +87 -0
- package/build/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.mjs +85 -0
- package/build/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/handleImmutable.js +31 -0
- package/build/node_modules/mongoose/lib/helpers/query/handleImmutable.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/handleImmutable.mjs +29 -0
- package/build/node_modules/mongoose/lib/helpers/query/handleImmutable.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js +22 -0
- package/build/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/hasDollarKeys.mjs +20 -0
- package/build/node_modules/mongoose/lib/helpers/query/hasDollarKeys.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/isOperator.js +14 -0
- package/build/node_modules/mongoose/lib/helpers/query/isOperator.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/isOperator.mjs +12 -0
- package/build/node_modules/mongoose/lib/helpers/query/isOperator.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js +17 -0
- package/build/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/sanitizeProjection.mjs +15 -0
- package/build/node_modules/mongoose/lib/helpers/query/sanitizeProjection.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js +52 -0
- package/build/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.mjs +50 -0
- package/build/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/wrapThunk.js +21 -0
- package/build/node_modules/mongoose/lib/helpers/query/wrapThunk.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/query/wrapThunk.mjs +19 -0
- package/build/node_modules/mongoose/lib/helpers/query/wrapThunk.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/addAutoId.js +10 -0
- package/build/node_modules/mongoose/lib/helpers/schema/addAutoId.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/addAutoId.mjs +8 -0
- package/build/node_modules/mongoose/lib/helpers/schema/addAutoId.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyPlugins.js +47 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyPlugins.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyPlugins.mjs +45 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyPlugins.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +33 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.mjs +31 -0
- package/build/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js +15 -0
- package/build/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.mjs +13 -0
- package/build/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getIndexes.js +158 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getIndexes.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getIndexes.mjs +156 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getIndexes.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getPath.js +38 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getPath.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getPath.mjs +36 -0
- package/build/node_modules/mongoose/lib/helpers/schema/getPath.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleIdOption.js +23 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleIdOption.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleIdOption.mjs +21 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleIdOption.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js +27 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.mjs +25 -0
- package/build/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/merge.js +30 -0
- package/build/node_modules/mongoose/lib/helpers/schema/merge.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schema/merge.mjs +28 -0
- package/build/node_modules/mongoose/lib/helpers/schema/merge.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +48 -0
- package/build/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/schematype/handleImmutable.mjs +46 -0
- package/build/node_modules/mongoose/lib/helpers/schematype/handleImmutable.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +134 -0
- package/build/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.mjs +132 -0
- package/build/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/specialProperties.js +6 -0
- package/build/node_modules/mongoose/lib/helpers/specialProperties.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/specialProperties.mjs +4 -0
- package/build/node_modules/mongoose/lib/helpers/specialProperties.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/symbols.js +61 -0
- package/build/node_modules/mongoose/lib/helpers/symbols.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/symbols.mjs +41 -0
- package/build/node_modules/mongoose/lib/helpers/symbols.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/timers.js +13 -0
- package/build/node_modules/mongoose/lib/helpers/timers.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/timers.mjs +9 -0
- package/build/node_modules/mongoose/lib/helpers/timers.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +114 -0
- package/build/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.mjs +112 -0
- package/build/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js +14 -0
- package/build/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/topology/allServersUnknown.mjs +12 -0
- package/build/node_modules/mongoose/lib/helpers/topology/allServersUnknown.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isAtlas.js +15 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isAtlas.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isAtlas.mjs +13 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isAtlas.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isSSLError.js +18 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isSSLError.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isSSLError.mjs +16 -0
- package/build/node_modules/mongoose/lib/helpers/topology/isSSLError.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js +175 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.mjs +173 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +124 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.mjs +122 -0
- package/build/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/castArrayFilters.js +63 -0
- package/build/node_modules/mongoose/lib/helpers/update/castArrayFilters.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/castArrayFilters.mjs +61 -0
- package/build/node_modules/mongoose/lib/helpers/update/castArrayFilters.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/modifiedPaths.js +38 -0
- package/build/node_modules/mongoose/lib/helpers/update/modifiedPaths.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/modifiedPaths.mjs +36 -0
- package/build/node_modules/mongoose/lib/helpers/update/modifiedPaths.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js +56 -0
- package/build/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.mjs +54 -0
- package/build/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +21 -0
- package/build/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.mjs +19 -0
- package/build/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js +27 -0
- package/build/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.mjs +25 -0
- package/build/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/updateValidators.js +263 -0
- package/build/node_modules/mongoose/lib/helpers/updateValidators.js.map +1 -0
- package/build/node_modules/mongoose/lib/helpers/updateValidators.mjs +261 -0
- package/build/node_modules/mongoose/lib/helpers/updateValidators.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/index.js +1208 -0
- package/build/node_modules/mongoose/lib/index.js.map +1 -0
- package/build/node_modules/mongoose/lib/index.mjs +1201 -0
- package/build/node_modules/mongoose/lib/index.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/internal.js +47 -0
- package/build/node_modules/mongoose/lib/internal.js.map +1 -0
- package/build/node_modules/mongoose/lib/internal.mjs +45 -0
- package/build/node_modules/mongoose/lib/internal.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/model.js +5089 -0
- package/build/node_modules/mongoose/lib/model.js.map +1 -0
- package/build/node_modules/mongoose/lib/model.mjs +5082 -0
- package/build/node_modules/mongoose/lib/model.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/PopulateOptions.js +39 -0
- package/build/node_modules/mongoose/lib/options/PopulateOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/PopulateOptions.mjs +37 -0
- package/build/node_modules/mongoose/lib/options/PopulateOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaArrayOptions.js +63 -0
- package/build/node_modules/mongoose/lib/options/SchemaArrayOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaArrayOptions.mjs +61 -0
- package/build/node_modules/mongoose/lib/options/SchemaArrayOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaBufferOptions.js +42 -0
- package/build/node_modules/mongoose/lib/options/SchemaBufferOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaBufferOptions.mjs +40 -0
- package/build/node_modules/mongoose/lib/options/SchemaBufferOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaDateOptions.js +68 -0
- package/build/node_modules/mongoose/lib/options/SchemaDateOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaDateOptions.mjs +66 -0
- package/build/node_modules/mongoose/lib/options/SchemaDateOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js +72 -0
- package/build/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.mjs +70 -0
- package/build/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaMapOptions.js +47 -0
- package/build/node_modules/mongoose/lib/options/SchemaMapOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaMapOptions.mjs +45 -0
- package/build/node_modules/mongoose/lib/options/SchemaMapOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaNumberOptions.js +103 -0
- package/build/node_modules/mongoose/lib/options/SchemaNumberOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaNumberOptions.mjs +101 -0
- package/build/node_modules/mongoose/lib/options/SchemaNumberOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js +67 -0
- package/build/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaObjectIdOptions.mjs +65 -0
- package/build/node_modules/mongoose/lib/options/SchemaObjectIdOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaSingleNestedOptions.js +46 -0
- package/build/node_modules/mongoose/lib/options/SchemaSingleNestedOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaSingleNestedOptions.mjs +44 -0
- package/build/node_modules/mongoose/lib/options/SchemaSingleNestedOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaStringOptions.js +142 -0
- package/build/node_modules/mongoose/lib/options/SchemaStringOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaStringOptions.mjs +140 -0
- package/build/node_modules/mongoose/lib/options/SchemaStringOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaTypeOptions.js +235 -0
- package/build/node_modules/mongoose/lib/options/SchemaTypeOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/SchemaTypeOptions.mjs +233 -0
- package/build/node_modules/mongoose/lib/options/SchemaTypeOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/VirtualOptions.js +167 -0
- package/build/node_modules/mongoose/lib/options/VirtualOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/VirtualOptions.mjs +165 -0
- package/build/node_modules/mongoose/lib/options/VirtualOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/propertyOptions.js +11 -0
- package/build/node_modules/mongoose/lib/options/propertyOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/propertyOptions.mjs +9 -0
- package/build/node_modules/mongoose/lib/options/propertyOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/removeOptions.js +17 -0
- package/build/node_modules/mongoose/lib/options/removeOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/removeOptions.mjs +15 -0
- package/build/node_modules/mongoose/lib/options/removeOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options/saveOptions.js +17 -0
- package/build/node_modules/mongoose/lib/options/saveOptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/options/saveOptions.mjs +15 -0
- package/build/node_modules/mongoose/lib/options/saveOptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/options.js +25 -0
- package/build/node_modules/mongoose/lib/options.js.map +1 -0
- package/build/node_modules/mongoose/lib/options.mjs +21 -0
- package/build/node_modules/mongoose/lib/options.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/idGetter.js +31 -0
- package/build/node_modules/mongoose/lib/plugins/idGetter.js.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/idGetter.mjs +29 -0
- package/build/node_modules/mongoose/lib/plugins/idGetter.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/removeSubdocs.js +34 -0
- package/build/node_modules/mongoose/lib/plugins/removeSubdocs.js.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/removeSubdocs.mjs +32 -0
- package/build/node_modules/mongoose/lib/plugins/removeSubdocs.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/saveSubdocs.js +69 -0
- package/build/node_modules/mongoose/lib/plugins/saveSubdocs.js.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/saveSubdocs.mjs +67 -0
- package/build/node_modules/mongoose/lib/plugins/saveSubdocs.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/sharding.js +93 -0
- package/build/node_modules/mongoose/lib/plugins/sharding.js.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/sharding.mjs +89 -0
- package/build/node_modules/mongoose/lib/plugins/sharding.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/trackTransaction.js +96 -0
- package/build/node_modules/mongoose/lib/plugins/trackTransaction.js.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/trackTransaction.mjs +94 -0
- package/build/node_modules/mongoose/lib/plugins/trackTransaction.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/validateBeforeSave.js +48 -0
- package/build/node_modules/mongoose/lib/plugins/validateBeforeSave.js.map +1 -0
- package/build/node_modules/mongoose/lib/plugins/validateBeforeSave.mjs +46 -0
- package/build/node_modules/mongoose/lib/plugins/validateBeforeSave.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/promise_provider.js +60 -0
- package/build/node_modules/mongoose/lib/promise_provider.js.map +1 -0
- package/build/node_modules/mongoose/lib/promise_provider.mjs +54 -0
- package/build/node_modules/mongoose/lib/promise_provider.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/query.js +5588 -0
- package/build/node_modules/mongoose/lib/query.js.map +1 -0
- package/build/node_modules/mongoose/lib/query.mjs +5582 -0
- package/build/node_modules/mongoose/lib/query.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/queryhelpers.js +341 -0
- package/build/node_modules/mongoose/lib/queryhelpers.js.map +1 -0
- package/build/node_modules/mongoose/lib/queryhelpers.mjs +339 -0
- package/build/node_modules/mongoose/lib/queryhelpers.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/SingleNestedPath.js +358 -0
- package/build/node_modules/mongoose/lib/schema/SingleNestedPath.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/SingleNestedPath.mjs +352 -0
- package/build/node_modules/mongoose/lib/schema/SingleNestedPath.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/array.js +676 -0
- package/build/node_modules/mongoose/lib/schema/array.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/array.mjs +670 -0
- package/build/node_modules/mongoose/lib/schema/array.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/boolean.js +278 -0
- package/build/node_modules/mongoose/lib/schema/boolean.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/boolean.mjs +276 -0
- package/build/node_modules/mongoose/lib/schema/boolean.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/buffer.js +276 -0
- package/build/node_modules/mongoose/lib/schema/buffer.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/buffer.mjs +274 -0
- package/build/node_modules/mongoose/lib/schema/buffer.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/date.js +411 -0
- package/build/node_modules/mongoose/lib/schema/date.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/date.mjs +409 -0
- package/build/node_modules/mongoose/lib/schema/date.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/decimal128.js +218 -0
- package/build/node_modules/mongoose/lib/schema/decimal128.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/decimal128.mjs +216 -0
- package/build/node_modules/mongoose/lib/schema/decimal128.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/documentarray.js +591 -0
- package/build/node_modules/mongoose/lib/schema/documentarray.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/documentarray.mjs +584 -0
- package/build/node_modules/mongoose/lib/schema/documentarray.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/index.js +52 -0
- package/build/node_modules/mongoose/lib/schema/index.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/index.mjs +50 -0
- package/build/node_modules/mongoose/lib/schema/index.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/map.js +84 -0
- package/build/node_modules/mongoose/lib/schema/map.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/map.mjs +82 -0
- package/build/node_modules/mongoose/lib/schema/map.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/mixed.js +140 -0
- package/build/node_modules/mongoose/lib/schema/mixed.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/mixed.mjs +138 -0
- package/build/node_modules/mongoose/lib/schema/mixed.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/number.js +443 -0
- package/build/node_modules/mongoose/lib/schema/number.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/number.mjs +441 -0
- package/build/node_modules/mongoose/lib/schema/number.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/objectid.js +307 -0
- package/build/node_modules/mongoose/lib/schema/objectid.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/objectid.mjs +305 -0
- package/build/node_modules/mongoose/lib/schema/objectid.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/bitwise.js +43 -0
- package/build/node_modules/mongoose/lib/schema/operators/bitwise.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/bitwise.mjs +41 -0
- package/build/node_modules/mongoose/lib/schema/operators/bitwise.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/exists.js +15 -0
- package/build/node_modules/mongoose/lib/schema/operators/exists.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/exists.mjs +13 -0
- package/build/node_modules/mongoose/lib/schema/operators/exists.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/geospatial.js +121 -0
- package/build/node_modules/mongoose/lib/schema/operators/geospatial.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/geospatial.mjs +115 -0
- package/build/node_modules/mongoose/lib/schema/operators/geospatial.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/helpers.js +46 -0
- package/build/node_modules/mongoose/lib/schema/operators/helpers.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/helpers.mjs +41 -0
- package/build/node_modules/mongoose/lib/schema/operators/helpers.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/text.js +42 -0
- package/build/node_modules/mongoose/lib/schema/operators/text.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/text.mjs +40 -0
- package/build/node_modules/mongoose/lib/schema/operators/text.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/type.js +23 -0
- package/build/node_modules/mongoose/lib/schema/operators/type.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/operators/type.mjs +21 -0
- package/build/node_modules/mongoose/lib/schema/operators/type.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/string.js +681 -0
- package/build/node_modules/mongoose/lib/schema/string.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/string.mjs +679 -0
- package/build/node_modules/mongoose/lib/schema/string.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema/symbols.js +17 -0
- package/build/node_modules/mongoose/lib/schema/symbols.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema/symbols.mjs +12 -0
- package/build/node_modules/mongoose/lib/schema/symbols.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schema.js +2205 -0
- package/build/node_modules/mongoose/lib/schema.js.map +1 -0
- package/build/node_modules/mongoose/lib/schema.mjs +2198 -0
- package/build/node_modules/mongoose/lib/schema.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/schematype.js +1694 -0
- package/build/node_modules/mongoose/lib/schematype.js.map +1 -0
- package/build/node_modules/mongoose/lib/schematype.mjs +1688 -0
- package/build/node_modules/mongoose/lib/schematype.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/statemachine.js +184 -0
- package/build/node_modules/mongoose/lib/statemachine.js.map +1 -0
- package/build/node_modules/mongoose/lib/statemachine.mjs +182 -0
- package/build/node_modules/mongoose/lib/statemachine.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/array.js +91 -0
- package/build/node_modules/mongoose/lib/types/array.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/array.mjs +89 -0
- package/build/node_modules/mongoose/lib/types/array.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/buffer.js +283 -0
- package/build/node_modules/mongoose/lib/types/buffer.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/buffer.mjs +281 -0
- package/build/node_modules/mongoose/lib/types/buffer.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/core_array.js +982 -0
- package/build/node_modules/mongoose/lib/types/core_array.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/core_array.mjs +976 -0
- package/build/node_modules/mongoose/lib/types/core_array.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/decimal128.js +18 -0
- package/build/node_modules/mongoose/lib/types/decimal128.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/decimal128.mjs +16 -0
- package/build/node_modules/mongoose/lib/types/decimal128.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/documentarray.js +462 -0
- package/build/node_modules/mongoose/lib/types/documentarray.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/documentarray.mjs +456 -0
- package/build/node_modules/mongoose/lib/types/documentarray.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/embedded.js +474 -0
- package/build/node_modules/mongoose/lib/types/embedded.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/embedded.mjs +467 -0
- package/build/node_modules/mongoose/lib/types/embedded.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/index.js +31 -0
- package/build/node_modules/mongoose/lib/types/index.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/index.mjs +29 -0
- package/build/node_modules/mongoose/lib/types/index.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/map.js +252 -0
- package/build/node_modules/mongoose/lib/types/map.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/map.mjs +246 -0
- package/build/node_modules/mongoose/lib/types/map.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/objectid.js +36 -0
- package/build/node_modules/mongoose/lib/types/objectid.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/objectid.mjs +34 -0
- package/build/node_modules/mongoose/lib/types/objectid.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/types/subdocument.js +308 -0
- package/build/node_modules/mongoose/lib/types/subdocument.js.map +1 -0
- package/build/node_modules/mongoose/lib/types/subdocument.mjs +306 -0
- package/build/node_modules/mongoose/lib/types/subdocument.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/utils.js +962 -0
- package/build/node_modules/mongoose/lib/utils.js.map +1 -0
- package/build/node_modules/mongoose/lib/utils.mjs +960 -0
- package/build/node_modules/mongoose/lib/utils.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/validoptions.js +39 -0
- package/build/node_modules/mongoose/lib/validoptions.js.map +1 -0
- package/build/node_modules/mongoose/lib/validoptions.mjs +37 -0
- package/build/node_modules/mongoose/lib/validoptions.mjs.map +1 -0
- package/build/node_modules/mongoose/lib/virtualtype.js +179 -0
- package/build/node_modules/mongoose/lib/virtualtype.js.map +1 -0
- package/build/node_modules/mongoose/lib/virtualtype.mjs +177 -0
- package/build/node_modules/mongoose/lib/virtualtype.mjs.map +1 -0
- package/build/node_modules/mongoose/node_modules/safe-buffer/index.js +80 -0
- package/build/node_modules/mongoose/node_modules/safe-buffer/index.js.map +1 -0
- package/build/node_modules/mongoose/node_modules/safe-buffer/index.mjs +74 -0
- package/build/node_modules/mongoose/node_modules/safe-buffer/index.mjs.map +1 -0
- package/build/node_modules/mongoose/package.json.js +299 -0
- package/build/node_modules/mongoose/package.json.js.map +1 -0
- package/build/node_modules/mongoose/package.mjs +277 -0
- package/build/node_modules/mongoose/package.mjs.map +1 -0
- package/build/node_modules/mongoose-legacy-pluralize/index.js +104 -0
- package/build/node_modules/mongoose-legacy-pluralize/index.js.map +1 -0
- package/build/node_modules/mongoose-legacy-pluralize/index.mjs +102 -0
- package/build/node_modules/mongoose-legacy-pluralize/index.mjs.map +1 -0
- package/build/node_modules/mpath/index.js +12 -0
- package/build/node_modules/mpath/index.js.map +1 -0
- package/build/node_modules/mpath/index.mjs +10 -0
- package/build/node_modules/mpath/index.mjs.map +1 -0
- package/build/node_modules/mpath/lib/index.js +325 -0
- package/build/node_modules/mpath/lib/index.js.map +1 -0
- package/build/node_modules/mpath/lib/index.mjs +323 -0
- package/build/node_modules/mpath/lib/index.mjs.map +1 -0
- package/build/node_modules/mpath/lib/stringToParts.js +51 -0
- package/build/node_modules/mpath/lib/stringToParts.js.map +1 -0
- package/build/node_modules/mpath/lib/stringToParts.mjs +49 -0
- package/build/node_modules/mpath/lib/stringToParts.mjs.map +1 -0
- package/build/node_modules/mquery/lib/collection/collection.js +54 -0
- package/build/node_modules/mquery/lib/collection/collection.js.map +1 -0
- package/build/node_modules/mquery/lib/collection/collection.mjs +52 -0
- package/build/node_modules/mquery/lib/collection/collection.mjs.map +1 -0
- package/build/node_modules/mquery/lib/collection/index.js +17 -0
- package/build/node_modules/mquery/lib/collection/index.js.map +1 -0
- package/build/node_modules/mquery/lib/collection/index.mjs +15 -0
- package/build/node_modules/mquery/lib/collection/index.mjs.map +1 -0
- package/build/node_modules/mquery/lib/collection/node.js +161 -0
- package/build/node_modules/mquery/lib/collection/node.js.map +1 -0
- package/build/node_modules/mquery/lib/collection/node.mjs +159 -0
- package/build/node_modules/mquery/lib/collection/node.mjs.map +1 -0
- package/build/node_modules/mquery/lib/env.js +30 -0
- package/build/node_modules/mquery/lib/env.js.map +1 -0
- package/build/node_modules/mquery/lib/env.mjs +28 -0
- package/build/node_modules/mquery/lib/env.mjs.map +1 -0
- package/build/node_modules/mquery/lib/mquery.js +3276 -0
- package/build/node_modules/mquery/lib/mquery.js.map +1 -0
- package/build/node_modules/mquery/lib/mquery.mjs +3268 -0
- package/build/node_modules/mquery/lib/mquery.mjs.map +1 -0
- package/build/node_modules/mquery/lib/permissions.js +96 -0
- package/build/node_modules/mquery/lib/permissions.js.map +1 -0
- package/build/node_modules/mquery/lib/permissions.mjs +94 -0
- package/build/node_modules/mquery/lib/permissions.mjs.map +1 -0
- package/build/node_modules/mquery/lib/utils.js +373 -0
- package/build/node_modules/mquery/lib/utils.js.map +1 -0
- package/build/node_modules/mquery/lib/utils.mjs +371 -0
- package/build/node_modules/mquery/lib/utils.mjs.map +1 -0
- package/build/node_modules/ms/index.js +166 -0
- package/build/node_modules/ms/index.js.map +1 -0
- package/build/node_modules/ms/index.mjs +164 -0
- package/build/node_modules/ms/index.mjs.map +1 -0
- package/build/node_modules/optional-require/index.js +82 -0
- package/build/node_modules/optional-require/index.js.map +1 -0
- package/build/node_modules/optional-require/index.mjs +76 -0
- package/build/node_modules/optional-require/index.mjs.map +1 -0
- package/build/node_modules/process-nextick-args/index.js +52 -0
- package/build/node_modules/process-nextick-args/index.js.map +1 -0
- package/build/node_modules/process-nextick-args/index.mjs +50 -0
- package/build/node_modules/process-nextick-args/index.mjs.map +1 -0
- package/build/node_modules/redis/index.js +1136 -0
- package/build/node_modules/redis/index.js.map +1 -0
- package/build/node_modules/redis/index.mjs +1127 -0
- package/build/node_modules/redis/index.mjs.map +1 -0
- package/build/node_modules/redis/lib/command.js +19 -0
- package/build/node_modules/redis/lib/command.js.map +1 -0
- package/build/node_modules/redis/lib/command.mjs +17 -0
- package/build/node_modules/redis/lib/command.mjs.map +1 -0
- package/build/node_modules/redis/lib/commands.js +127 -0
- package/build/node_modules/redis/lib/commands.js.map +1 -0
- package/build/node_modules/redis/lib/commands.mjs +125 -0
- package/build/node_modules/redis/lib/commands.mjs.map +1 -0
- package/build/node_modules/redis/lib/createClient.js +87 -0
- package/build/node_modules/redis/lib/createClient.js.map +1 -0
- package/build/node_modules/redis/lib/createClient.mjs +81 -0
- package/build/node_modules/redis/lib/createClient.mjs.map +1 -0
- package/build/node_modules/redis/lib/customErrors.js +69 -0
- package/build/node_modules/redis/lib/customErrors.js.map +1 -0
- package/build/node_modules/redis/lib/customErrors.mjs +62 -0
- package/build/node_modules/redis/lib/customErrors.mjs.map +1 -0
- package/build/node_modules/redis/lib/debug.js +14 -0
- package/build/node_modules/redis/lib/debug.js.map +1 -0
- package/build/node_modules/redis/lib/debug.mjs +12 -0
- package/build/node_modules/redis/lib/debug.mjs.map +1 -0
- package/build/node_modules/redis/lib/extendedApi.js +117 -0
- package/build/node_modules/redis/lib/extendedApi.js.map +1 -0
- package/build/node_modules/redis/lib/extendedApi.mjs +115 -0
- package/build/node_modules/redis/lib/extendedApi.mjs.map +1 -0
- package/build/node_modules/redis/lib/individualCommands.js +620 -0
- package/build/node_modules/redis/lib/individualCommands.js.map +1 -0
- package/build/node_modules/redis/lib/individualCommands.mjs +618 -0
- package/build/node_modules/redis/lib/individualCommands.mjs.map +1 -0
- package/build/node_modules/redis/lib/multi.js +190 -0
- package/build/node_modules/redis/lib/multi.js.map +1 -0
- package/build/node_modules/redis/lib/multi.mjs +188 -0
- package/build/node_modules/redis/lib/multi.mjs.map +1 -0
- package/build/node_modules/redis/lib/utils.js +137 -0
- package/build/node_modules/redis/lib/utils.js.map +1 -0
- package/build/node_modules/redis/lib/utils.mjs +135 -0
- package/build/node_modules/redis/lib/utils.mjs.map +1 -0
- package/build/node_modules/redis-commands/commands.json.js +2785 -0
- package/build/node_modules/redis-commands/commands.json.js.map +1 -0
- package/build/node_modules/redis-commands/commands.mjs +2560 -0
- package/build/node_modules/redis-commands/commands.mjs.map +1 -0
- package/build/node_modules/redis-commands/index.js +177 -0
- package/build/node_modules/redis-commands/index.js.map +1 -0
- package/build/node_modules/redis-commands/index.mjs +175 -0
- package/build/node_modules/redis-commands/index.mjs.map +1 -0
- package/build/node_modules/redis-parser/index.js +21 -0
- package/build/node_modules/redis-parser/index.js.map +1 -0
- package/build/node_modules/redis-parser/index.mjs +15 -0
- package/build/node_modules/redis-parser/index.mjs.map +1 -0
- package/build/node_modules/redis-parser/lib/hiredis.js +69 -0
- package/build/node_modules/redis-parser/lib/hiredis.js.map +1 -0
- package/build/node_modules/redis-parser/lib/hiredis.mjs +63 -0
- package/build/node_modules/redis-parser/lib/hiredis.mjs.map +1 -0
- package/build/node_modules/redis-parser/lib/parser.js +593 -0
- package/build/node_modules/redis-parser/lib/parser.js.map +1 -0
- package/build/node_modules/redis-parser/lib/parser.mjs +587 -0
- package/build/node_modules/redis-parser/lib/parser.mjs.map +1 -0
- package/build/node_modules/redis-parser/lib/parserError.js +34 -0
- package/build/node_modules/redis-parser/lib/parserError.js.map +1 -0
- package/build/node_modules/redis-parser/lib/parserError.mjs +27 -0
- package/build/node_modules/redis-parser/lib/parserError.mjs.map +1 -0
- package/build/node_modules/redis-parser/lib/redisError.js +31 -0
- package/build/node_modules/redis-parser/lib/redisError.js.map +1 -0
- package/build/node_modules/redis-parser/lib/redisError.mjs +25 -0
- package/build/node_modules/redis-parser/lib/redisError.mjs.map +1 -0
- package/build/node_modules/redis-parser/lib/replyError.js +31 -0
- package/build/node_modules/redis-parser/lib/replyError.js.map +1 -0
- package/build/node_modules/redis-parser/lib/replyError.mjs +25 -0
- package/build/node_modules/redis-parser/lib/replyError.mjs.map +1 -0
- package/build/node_modules/regexp-clone/index.js +34 -0
- package/build/node_modules/regexp-clone/index.js.map +1 -0
- package/build/node_modules/regexp-clone/index.mjs +32 -0
- package/build/node_modules/regexp-clone/index.mjs.map +1 -0
- package/build/node_modules/safe-buffer/index.js +76 -0
- package/build/node_modules/safe-buffer/index.js.map +1 -0
- package/build/node_modules/safe-buffer/index.mjs +70 -0
- package/build/node_modules/safe-buffer/index.mjs.map +1 -0
- package/build/node_modules/saslprep/index.js +162 -0
- package/build/node_modules/saslprep/index.js.map +1 -0
- package/build/node_modules/saslprep/index.mjs +160 -0
- package/build/node_modules/saslprep/index.mjs.map +1 -0
- package/build/node_modules/saslprep/lib/memory-code-points.js +47 -0
- package/build/node_modules/saslprep/lib/memory-code-points.js.map +1 -0
- package/build/node_modules/saslprep/lib/memory-code-points.mjs +40 -0
- package/build/node_modules/saslprep/lib/memory-code-points.mjs.map +1 -0
- package/build/node_modules/sift/es5m/index.js +683 -0
- package/build/node_modules/sift/es5m/index.js.map +1 -0
- package/build/node_modules/sift/es5m/index.mjs +652 -0
- package/build/node_modules/sift/es5m/index.mjs.map +1 -0
- package/build/node_modules/sliced/index.js +36 -0
- package/build/node_modules/sliced/index.js.map +1 -0
- package/build/node_modules/sliced/index.mjs +34 -0
- package/build/node_modules/sliced/index.mjs.map +1 -0
- package/build/node_modules/sparse-bitfield/index.js +100 -0
- package/build/node_modules/sparse-bitfield/index.js.map +1 -0
- package/build/node_modules/sparse-bitfield/index.mjs +98 -0
- package/build/node_modules/sparse-bitfield/index.mjs.map +1 -0
- package/build/node_modules/util-deprecate/node.js +16 -0
- package/build/node_modules/util-deprecate/node.js.map +1 -0
- package/build/node_modules/util-deprecate/node.mjs +10 -0
- package/build/node_modules/util-deprecate/node.mjs.map +1 -0
- package/build/node_modules/ws/index.js +17 -0
- package/build/node_modules/ws/index.js.map +1 -0
- package/build/node_modules/ws/index.mjs +15 -0
- package/build/node_modules/ws/index.mjs.map +1 -0
- package/build/node_modules/ws/lib/buffer-util.js +143 -0
- package/build/node_modules/ws/lib/buffer-util.js.map +1 -0
- package/build/node_modules/ws/lib/buffer-util.mjs +137 -0
- package/build/node_modules/ws/lib/buffer-util.mjs.map +1 -0
- package/build/node_modules/ws/lib/constants.js +13 -0
- package/build/node_modules/ws/lib/constants.js.map +1 -0
- package/build/node_modules/ws/lib/constants.mjs +11 -0
- package/build/node_modules/ws/lib/constants.mjs.map +1 -0
- package/build/node_modules/ws/lib/event-target.js +187 -0
- package/build/node_modules/ws/lib/event-target.js.map +1 -0
- package/build/node_modules/ws/lib/event-target.mjs +185 -0
- package/build/node_modules/ws/lib/event-target.mjs.map +1 -0
- package/build/node_modules/ws/lib/extension.js +226 -0
- package/build/node_modules/ws/lib/extension.js.map +1 -0
- package/build/node_modules/ws/lib/extension.mjs +224 -0
- package/build/node_modules/ws/lib/extension.mjs.map +1 -0
- package/build/node_modules/ws/lib/limiter.js +58 -0
- package/build/node_modules/ws/lib/limiter.js.map +1 -0
- package/build/node_modules/ws/lib/limiter.mjs +56 -0
- package/build/node_modules/ws/lib/limiter.mjs.map +1 -0
- package/build/node_modules/ws/lib/permessage-deflate.js +526 -0
- package/build/node_modules/ws/lib/permessage-deflate.js.map +1 -0
- package/build/node_modules/ws/lib/permessage-deflate.mjs +520 -0
- package/build/node_modules/ws/lib/permessage-deflate.mjs.map +1 -0
- package/build/node_modules/ws/lib/receiver.js +620 -0
- package/build/node_modules/ws/lib/receiver.js.map +1 -0
- package/build/node_modules/ws/lib/receiver.mjs +614 -0
- package/build/node_modules/ws/lib/receiver.mjs.map +1 -0
- package/build/node_modules/ws/lib/sender.js +424 -0
- package/build/node_modules/ws/lib/sender.js.map +1 -0
- package/build/node_modules/ws/lib/sender.mjs +418 -0
- package/build/node_modules/ws/lib/sender.mjs.map +1 -0
- package/build/node_modules/ws/lib/stream.js +186 -0
- package/build/node_modules/ws/lib/stream.js.map +1 -0
- package/build/node_modules/ws/lib/stream.mjs +180 -0
- package/build/node_modules/ws/lib/stream.mjs.map +1 -0
- package/build/node_modules/ws/lib/validation.js +117 -0
- package/build/node_modules/ws/lib/validation.js.map +1 -0
- package/build/node_modules/ws/lib/validation.mjs +111 -0
- package/build/node_modules/ws/lib/validation.mjs.map +1 -0
- package/build/node_modules/ws/lib/websocket-server.js +467 -0
- package/build/node_modules/ws/lib/websocket-server.js.map +1 -0
- package/build/node_modules/ws/lib/websocket-server.mjs +459 -0
- package/build/node_modules/ws/lib/websocket-server.mjs.map +1 -0
- package/build/node_modules/ws/lib/websocket.js +1138 -0
- package/build/node_modules/ws/lib/websocket.js.map +1 -0
- package/build/node_modules/ws/lib/websocket.mjs +1126 -0
- package/build/node_modules/ws/lib/websocket.mjs.map +1 -0
- package/build/packages/core/src/Debug.js +34 -0
- package/build/packages/core/src/Debug.js.map +1 -0
- package/build/packages/core/src/Debug.mjs +20 -0
- package/build/packages/core/src/Debug.mjs.map +1 -0
- package/build/packages/core/src/IPC.js +65 -0
- package/build/packages/core/src/IPC.js.map +1 -0
- package/build/packages/core/src/IPC.mjs +60 -0
- package/build/packages/core/src/IPC.mjs.map +1 -0
- package/build/packages/core/src/Logger.js +12 -0
- package/build/packages/core/src/Logger.js.map +1 -0
- package/build/packages/core/src/Logger.mjs +8 -0
- package/build/packages/core/src/Logger.mjs.map +1 -0
- package/build/packages/core/src/MatchMaker.js +401 -0
- package/build/packages/core/src/MatchMaker.js.map +1 -0
- package/build/packages/core/src/MatchMaker.mjs +382 -0
- package/build/packages/core/src/MatchMaker.mjs.map +1 -0
- package/build/packages/core/src/Protocol.js +164 -0
- package/build/packages/core/src/Protocol.js.map +1 -0
- package/build/packages/core/src/Protocol.mjs +154 -0
- package/build/packages/core/src/Protocol.mjs.map +1 -0
- package/build/packages/core/src/Room.js +569 -0
- package/build/packages/core/src/Room.js.map +1 -0
- package/build/packages/core/src/Room.mjs +559 -0
- package/build/packages/core/src/Room.mjs.map +1 -0
- package/build/packages/core/src/Server.js +222 -0
- package/build/packages/core/src/Server.js.map +1 -0
- package/build/packages/core/src/Server.mjs +218 -0
- package/build/packages/core/src/Server.mjs.map +1 -0
- package/build/packages/core/src/Transport.js +17 -0
- package/build/packages/core/src/Transport.js.map +1 -0
- package/build/packages/core/src/Transport.mjs +13 -0
- package/build/packages/core/src/Transport.mjs.map +1 -0
- package/build/packages/core/src/Utils.js +225 -0
- package/build/packages/core/src/Utils.js.map +1 -0
- package/build/packages/core/src/Utils.mjs +209 -0
- package/build/packages/core/src/Utils.mjs.map +1 -0
- package/build/packages/core/src/discovery/index.js +31 -0
- package/build/packages/core/src/discovery/index.js.map +1 -0
- package/build/packages/core/src/discovery/index.mjs +22 -0
- package/build/packages/core/src/discovery/index.mjs.map +1 -0
- package/build/packages/core/src/errors/SeatReservationError.js +12 -0
- package/build/packages/core/src/errors/SeatReservationError.js.map +1 -0
- package/build/packages/core/src/errors/SeatReservationError.mjs +8 -0
- package/build/packages/core/src/errors/SeatReservationError.mjs.map +1 -0
- package/build/packages/core/src/errors/ServerError.js +21 -0
- package/build/packages/core/src/errors/ServerError.js.map +1 -0
- package/build/packages/core/src/errors/ServerError.mjs +17 -0
- package/build/packages/core/src/errors/ServerError.mjs.map +1 -0
- package/build/packages/core/src/index.js +96 -0
- package/build/packages/core/src/index.js.map +1 -0
- package/build/packages/core/src/index.mjs +19 -0
- package/build/packages/core/src/index.mjs.map +1 -0
- package/build/packages/core/src/matchmaker/Lobby.js +31 -0
- package/build/packages/core/src/matchmaker/Lobby.js.map +1 -0
- package/build/packages/core/src/matchmaker/Lobby.mjs +26 -0
- package/build/packages/core/src/matchmaker/Lobby.mjs.map +1 -0
- package/build/packages/core/src/matchmaker/RegisteredHandler.js +72 -0
- package/build/packages/core/src/matchmaker/RegisteredHandler.js.map +1 -0
- package/build/packages/core/src/matchmaker/RegisteredHandler.mjs +67 -0
- package/build/packages/core/src/matchmaker/RegisteredHandler.mjs.map +1 -0
- package/build/packages/core/src/matchmaker/controller.js +46 -0
- package/build/packages/core/src/matchmaker/controller.js.map +1 -0
- package/build/packages/core/src/matchmaker/controller.mjs +39 -0
- package/build/packages/core/src/matchmaker/controller.mjs.map +1 -0
- package/build/packages/core/src/matchmaker/driver/Query.js +53 -0
- package/build/packages/core/src/matchmaker/driver/Query.js.map +1 -0
- package/build/packages/core/src/matchmaker/driver/Query.mjs +49 -0
- package/build/packages/core/src/matchmaker/driver/Query.mjs.map +1 -0
- package/build/packages/core/src/matchmaker/driver/RoomData.js +80 -0
- package/build/packages/core/src/matchmaker/driver/RoomData.js.map +1 -0
- package/build/packages/core/src/matchmaker/driver/RoomData.mjs +76 -0
- package/build/packages/core/src/matchmaker/driver/RoomData.mjs.map +1 -0
- package/build/packages/core/src/matchmaker/driver/index.js +34 -0
- package/build/packages/core/src/matchmaker/driver/index.js.map +1 -0
- package/build/packages/core/src/matchmaker/driver/index.mjs +30 -0
- package/build/packages/core/src/matchmaker/driver/index.mjs.map +1 -0
- package/build/packages/core/src/presence/LocalPresence.js +156 -0
- package/build/packages/core/src/presence/LocalPresence.js.map +1 -0
- package/build/packages/core/src/presence/LocalPresence.mjs +152 -0
- package/build/packages/core/src/presence/LocalPresence.mjs.map +1 -0
- package/build/packages/core/src/rooms/LobbyRoom.js +101 -0
- package/build/packages/core/src/rooms/LobbyRoom.js.map +1 -0
- package/build/packages/core/src/rooms/LobbyRoom.mjs +97 -0
- package/build/packages/core/src/rooms/LobbyRoom.mjs.map +1 -0
- package/build/packages/core/src/rooms/RelayRoom.js +79 -0
- package/build/packages/core/src/rooms/RelayRoom.js.map +1 -0
- package/build/packages/core/src/rooms/RelayRoom.mjs +75 -0
- package/build/packages/core/src/rooms/RelayRoom.mjs.map +1 -0
- package/build/packages/core/src/serializer/NoneSerializer.js +19 -0
- package/build/packages/core/src/serializer/NoneSerializer.js.map +1 -0
- package/build/packages/core/src/serializer/NoneSerializer.mjs +15 -0
- package/build/packages/core/src/serializer/NoneSerializer.mjs.map +1 -0
- package/build/packages/core/src/serializer/SchemaSerializer.js +85 -0
- package/build/packages/core/src/serializer/SchemaSerializer.js.map +1 -0
- package/build/packages/core/src/serializer/SchemaSerializer.mjs +81 -0
- package/build/packages/core/src/serializer/SchemaSerializer.mjs.map +1 -0
- package/build/packages/drivers/mongoose-driver/build/index.mjs +23 -0
- package/build/packages/drivers/mongoose-driver/build/index.mjs.js +25 -0
- package/build/packages/drivers/mongoose-driver/build/index.mjs.js.map +1 -0
- package/build/packages/drivers/mongoose-driver/build/index.mjs.map +1 -0
- package/build/packages/transport/ws-transport/build/WebSocketClient.mjs +70 -0
- package/build/packages/transport/ws-transport/build/WebSocketClient.mjs.js +74 -0
- package/build/packages/transport/ws-transport/build/WebSocketClient.mjs.js.map +1 -0
- package/build/packages/transport/ws-transport/build/WebSocketClient.mjs.map +1 -0
- package/build/packages/transport/ws-transport/build/WebSocketTransport.mjs +102 -0
- package/build/packages/transport/ws-transport/build/WebSocketTransport.mjs.js +110 -0
- package/build/packages/transport/ws-transport/build/WebSocketTransport.mjs.js.map +1 -0
- package/build/packages/transport/ws-transport/build/WebSocketTransport.mjs.map +1 -0
- package/build/rooms/LobbyRoom.js +4 -4
- package/build/rooms/LobbyRoom.js.map +1 -1
- package/build/rooms/LobbyRoom.mjs +4 -4
- package/build/rooms/LobbyRoom.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,4298 @@
|
|
|
1
|
+
import { createCommonjsModule } from '../../../_virtual/_commonjsHelpers.js';
|
|
2
|
+
import require$$0 from 'events';
|
|
3
|
+
import internal from './internal.mjs';
|
|
4
|
+
import error from './error/index.mjs';
|
|
5
|
+
import mixed from './schema/mixed.mjs';
|
|
6
|
+
import objectExpected from './error/objectExpected.mjs';
|
|
7
|
+
import objectParameter from './error/objectParameter.mjs';
|
|
8
|
+
import parallelValidate from './error/parallelValidate.mjs';
|
|
9
|
+
import schema from './schema.mjs';
|
|
10
|
+
import strict from './error/strict.mjs';
|
|
11
|
+
import validation from './error/validation.mjs';
|
|
12
|
+
import validator from './error/validator.mjs';
|
|
13
|
+
import virtualtype from './virtualtype.mjs';
|
|
14
|
+
import promiseOrCallback from './helpers/promiseOrCallback.mjs';
|
|
15
|
+
import cleanModifiedSubpaths from './helpers/document/cleanModifiedSubpaths.mjs';
|
|
16
|
+
import compile_1 from './helpers/document/compile.mjs';
|
|
17
|
+
import common from './helpers/common.mjs';
|
|
18
|
+
import get from './helpers/get.mjs';
|
|
19
|
+
import getEmbeddedDiscriminatorPath from './helpers/document/getEmbeddedDiscriminatorPath.mjs';
|
|
20
|
+
import handleSpreadDoc from './helpers/document/handleSpreadDoc.mjs';
|
|
21
|
+
import idGetter_1 from './plugins/idGetter.mjs';
|
|
22
|
+
import immediate from './helpers/immediate.mjs';
|
|
23
|
+
import isDefiningProjection from './helpers/projection/isDefiningProjection.mjs';
|
|
24
|
+
import isExclusive from './helpers/projection/isExclusive.mjs';
|
|
25
|
+
import util from 'util';
|
|
26
|
+
import options from './options.mjs';
|
|
27
|
+
import mpath from '../../mpath/index.mjs';
|
|
28
|
+
import queryhelpers from './queryhelpers.mjs';
|
|
29
|
+
import utils from './utils.mjs';
|
|
30
|
+
import isPromise_1 from './helpers/isPromise.mjs';
|
|
31
|
+
import symbols from './helpers/symbols.mjs';
|
|
32
|
+
import symbols$1 from './schema/symbols.mjs';
|
|
33
|
+
import embedded from './types/embedded.mjs';
|
|
34
|
+
import './types/array.mjs';
|
|
35
|
+
import './types/documentarray.mjs';
|
|
36
|
+
|
|
37
|
+
var document = createCommonjsModule(function (module, exports) {
|
|
38
|
+
|
|
39
|
+
/*!
|
|
40
|
+
* Module dependencies.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
const EventEmitter = require$$0.EventEmitter;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
const compile = compile_1.compile;
|
|
58
|
+
const defineKey = compile_1.defineKey;
|
|
59
|
+
const flatten = common.flatten;
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const inspect = util.inspect;
|
|
68
|
+
const internalToObjectOptions = options.internalToObjectOptions;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
const clone = utils.clone;
|
|
75
|
+
const deepEqual = utils.deepEqual;
|
|
76
|
+
const isMongooseObject = utils.isMongooseObject;
|
|
77
|
+
|
|
78
|
+
const arrayAtomicsBackupSymbol = Symbol('mongoose.Array#atomicsBackup');
|
|
79
|
+
const arrayAtomicsSymbol = symbols.arrayAtomicsSymbol;
|
|
80
|
+
const documentArrayParent = symbols.documentArrayParent;
|
|
81
|
+
const documentIsModified = symbols.documentIsModified;
|
|
82
|
+
const documentModifiedPaths = symbols.documentModifiedPaths;
|
|
83
|
+
const documentSchemaSymbol = symbols.documentSchemaSymbol;
|
|
84
|
+
const getSymbol = symbols.getSymbol;
|
|
85
|
+
const populateModelSymbol = symbols.populateModelSymbol;
|
|
86
|
+
const scopeSymbol = symbols.scopeSymbol;
|
|
87
|
+
const schemaMixedSymbol = symbols$1.schemaMixedSymbol;
|
|
88
|
+
let Embedded;
|
|
89
|
+
|
|
90
|
+
const specialProperties = utils.specialProperties;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The core Mongoose document constructor. You should not call this directly,
|
|
94
|
+
* the Mongoose [Model constructor](./api.html#Model) calls this for you.
|
|
95
|
+
*
|
|
96
|
+
* @param {Object} obj the values to set
|
|
97
|
+
* @param {Object} [fields] optional object containing the fields which were selected in the query returning this document and any populated paths data
|
|
98
|
+
* @param {Object} [options] various configuration options for the document
|
|
99
|
+
* @param {Boolean} [options.defaults=true] if `false`, skip applying default values to this document.
|
|
100
|
+
* @inherits NodeJS EventEmitter http://nodejs.org/api/events.html#events_class_events_eventemitter
|
|
101
|
+
* @event `init`: Emitted on a document after it has been retrieved from the db and fully hydrated by Mongoose.
|
|
102
|
+
* @event `save`: Emitted when the document is successfully saved
|
|
103
|
+
* @api private
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
function Document(obj, fields, skipId, options) {
|
|
107
|
+
if (typeof skipId === 'object' && skipId != null) {
|
|
108
|
+
options = skipId;
|
|
109
|
+
skipId = options.skipId;
|
|
110
|
+
}
|
|
111
|
+
options = Object.assign({}, options);
|
|
112
|
+
const defaults = get(options, 'defaults', true);
|
|
113
|
+
options.defaults = defaults;
|
|
114
|
+
// Support `browserDocument.js` syntax
|
|
115
|
+
if (this.$__schema == null) {
|
|
116
|
+
const _schema = utils.isObject(fields) && !fields.instanceOfSchema ?
|
|
117
|
+
new schema(fields) :
|
|
118
|
+
fields;
|
|
119
|
+
this.$__setSchema(_schema);
|
|
120
|
+
fields = skipId;
|
|
121
|
+
skipId = options;
|
|
122
|
+
options = arguments[4] || {};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
this.$__ = new internal;
|
|
126
|
+
this.$__.emitter = new EventEmitter();
|
|
127
|
+
this.isNew = 'isNew' in options ? options.isNew : true;
|
|
128
|
+
this.errors = undefined;
|
|
129
|
+
this.$__.$options = options || {};
|
|
130
|
+
this.$locals = {};
|
|
131
|
+
this.$op = null;
|
|
132
|
+
if (obj != null && typeof obj !== 'object') {
|
|
133
|
+
throw new objectParameter(obj, 'obj', 'Document');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const schema$1 = this.$__schema;
|
|
137
|
+
|
|
138
|
+
if (typeof fields === 'boolean' || fields === 'throw') {
|
|
139
|
+
this.$__.strictMode = fields;
|
|
140
|
+
fields = undefined;
|
|
141
|
+
} else {
|
|
142
|
+
this.$__.strictMode = schema$1.options.strict;
|
|
143
|
+
this.$__.selected = fields;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const requiredPaths = schema$1.requiredPaths(true);
|
|
147
|
+
for (const path of requiredPaths) {
|
|
148
|
+
this.$__.activePaths.require(path);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
this.$__.emitter.setMaxListeners(0);
|
|
152
|
+
|
|
153
|
+
let exclude = null;
|
|
154
|
+
|
|
155
|
+
// determine if this doc is a result of a query with
|
|
156
|
+
// excluded fields
|
|
157
|
+
if (utils.isPOJO(fields)) {
|
|
158
|
+
exclude = isExclusive(fields);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const hasIncludedChildren = exclude === false && fields ?
|
|
162
|
+
$__hasIncludedChildren(fields) :
|
|
163
|
+
{};
|
|
164
|
+
|
|
165
|
+
if (this._doc == null) {
|
|
166
|
+
this.$__buildDoc(obj, fields, skipId, exclude, hasIncludedChildren, false);
|
|
167
|
+
|
|
168
|
+
// By default, defaults get applied **before** setting initial values
|
|
169
|
+
// Re: gh-6155
|
|
170
|
+
if (defaults) {
|
|
171
|
+
$__applyDefaults(this, fields, skipId, exclude, hasIncludedChildren, true, {
|
|
172
|
+
isNew: this.isNew
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (obj) {
|
|
177
|
+
// Skip set hooks
|
|
178
|
+
if (this.$__original_set) {
|
|
179
|
+
this.$__original_set(obj, undefined, true);
|
|
180
|
+
} else {
|
|
181
|
+
this.$set(obj, undefined, true);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (obj instanceof Document) {
|
|
185
|
+
this.isNew = obj.isNew;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Function defaults get applied **after** setting initial values so they
|
|
190
|
+
// see the full doc rather than an empty one, unless they opt out.
|
|
191
|
+
// Re: gh-3781, gh-6155
|
|
192
|
+
if (options.willInit && defaults) {
|
|
193
|
+
EventEmitter.prototype.once.call(this, 'init', () => {
|
|
194
|
+
$__applyDefaults(this, fields, skipId, exclude, hasIncludedChildren, false, options.skipDefaults, {
|
|
195
|
+
isNew: this.isNew
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
} else if (defaults) {
|
|
199
|
+
$__applyDefaults(this, fields, skipId, exclude, hasIncludedChildren, false, options.skipDefaults, {
|
|
200
|
+
isNew: this.isNew
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
this.$__._id = this._id;
|
|
205
|
+
|
|
206
|
+
if (!this.$__.strictMode && obj) {
|
|
207
|
+
const _this = this;
|
|
208
|
+
const keys = Object.keys(this._doc);
|
|
209
|
+
|
|
210
|
+
keys.forEach(function(key) {
|
|
211
|
+
if (!(key in schema$1.tree)) {
|
|
212
|
+
defineKey(key, null, _this);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
applyQueue(this);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/*!
|
|
221
|
+
* Document exposes the NodeJS event emitter API, so you can use
|
|
222
|
+
* `on`, `once`, etc.
|
|
223
|
+
*/
|
|
224
|
+
utils.each(
|
|
225
|
+
['on', 'once', 'emit', 'listeners', 'removeListener', 'setMaxListeners',
|
|
226
|
+
'removeAllListeners', 'addListener'],
|
|
227
|
+
function(emitterFn) {
|
|
228
|
+
Document.prototype[emitterFn] = function() {
|
|
229
|
+
return this.$__.emitter[emitterFn].apply(this.$__.emitter, arguments);
|
|
230
|
+
};
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
Document.prototype.constructor = Document;
|
|
234
|
+
|
|
235
|
+
for (const i in EventEmitter.prototype) {
|
|
236
|
+
Document[i] = EventEmitter.prototype[i];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The document's internal schema.
|
|
241
|
+
*
|
|
242
|
+
* @api private
|
|
243
|
+
* @property schema
|
|
244
|
+
* @memberOf Document
|
|
245
|
+
* @instance
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
Document.prototype.$__schema;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* The document's schema.
|
|
252
|
+
*
|
|
253
|
+
* @api public
|
|
254
|
+
* @property schema
|
|
255
|
+
* @memberOf Document
|
|
256
|
+
* @instance
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
Document.prototype.schema;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Empty object that you can use for storing properties on the document. This
|
|
263
|
+
* is handy for passing data to middleware without conflicting with Mongoose
|
|
264
|
+
* internals.
|
|
265
|
+
*
|
|
266
|
+
* ####Example:
|
|
267
|
+
*
|
|
268
|
+
* schema.pre('save', function() {
|
|
269
|
+
* // Mongoose will set `isNew` to `false` if `save()` succeeds
|
|
270
|
+
* this.$locals.wasNew = this.isNew;
|
|
271
|
+
* });
|
|
272
|
+
*
|
|
273
|
+
* schema.post('save', function() {
|
|
274
|
+
* // Prints true if `isNew` was set before `save()`
|
|
275
|
+
* console.log(this.$locals.wasNew);
|
|
276
|
+
* });
|
|
277
|
+
*
|
|
278
|
+
* @api public
|
|
279
|
+
* @property $locals
|
|
280
|
+
* @memberOf Document
|
|
281
|
+
* @instance
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
Object.defineProperty(Document.prototype, '$locals', {
|
|
285
|
+
configurable: false,
|
|
286
|
+
enumerable: false,
|
|
287
|
+
writable: true
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Boolean flag specifying if the document is new.
|
|
292
|
+
*
|
|
293
|
+
* @api public
|
|
294
|
+
* @property isNew
|
|
295
|
+
* @memberOf Document
|
|
296
|
+
* @instance
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
Document.prototype.isNew;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The string version of this documents _id.
|
|
303
|
+
*
|
|
304
|
+
* ####Note:
|
|
305
|
+
*
|
|
306
|
+
* This getter exists on all documents by default. The getter can be disabled by setting the `id` [option](/docs/guide.html#id) of its `Schema` to false at construction time.
|
|
307
|
+
*
|
|
308
|
+
* new Schema({ name: String }, { id: false });
|
|
309
|
+
*
|
|
310
|
+
* @api public
|
|
311
|
+
* @see Schema options /docs/guide.html#options
|
|
312
|
+
* @property id
|
|
313
|
+
* @memberOf Document
|
|
314
|
+
* @instance
|
|
315
|
+
*/
|
|
316
|
+
|
|
317
|
+
Document.prototype.id;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Hash containing current validation errors.
|
|
321
|
+
*
|
|
322
|
+
* @api public
|
|
323
|
+
* @property errors
|
|
324
|
+
* @memberOf Document
|
|
325
|
+
* @instance
|
|
326
|
+
*/
|
|
327
|
+
|
|
328
|
+
Document.prototype.errors;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* A string containing the current operation that Mongoose is executing
|
|
332
|
+
* on this document. May be `null`, `'save'`, `'validate'`, or `'remove'`.
|
|
333
|
+
*
|
|
334
|
+
* ####Example:
|
|
335
|
+
*
|
|
336
|
+
* const doc = new Model({ name: 'test' });
|
|
337
|
+
* doc.$op; // null
|
|
338
|
+
*
|
|
339
|
+
* const promise = doc.save();
|
|
340
|
+
* doc.$op; // 'save'
|
|
341
|
+
*
|
|
342
|
+
* await promise;
|
|
343
|
+
* doc.$op; // null
|
|
344
|
+
*
|
|
345
|
+
* @api public
|
|
346
|
+
* @property $op
|
|
347
|
+
* @memberOf Document
|
|
348
|
+
* @instance
|
|
349
|
+
*/
|
|
350
|
+
|
|
351
|
+
Document.prototype.$op;
|
|
352
|
+
|
|
353
|
+
/*!
|
|
354
|
+
* ignore
|
|
355
|
+
*/
|
|
356
|
+
|
|
357
|
+
function $__hasIncludedChildren(fields) {
|
|
358
|
+
const hasIncludedChildren = {};
|
|
359
|
+
const keys = Object.keys(fields);
|
|
360
|
+
|
|
361
|
+
for (const key of keys) {
|
|
362
|
+
const parts = key.split('.');
|
|
363
|
+
const c = [];
|
|
364
|
+
|
|
365
|
+
for (const part of parts) {
|
|
366
|
+
c.push(part);
|
|
367
|
+
hasIncludedChildren[c.join('.')] = 1;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
return hasIncludedChildren;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/*!
|
|
375
|
+
* ignore
|
|
376
|
+
*/
|
|
377
|
+
|
|
378
|
+
function $__applyDefaults(doc, fields, skipId, exclude, hasIncludedChildren, isBeforeSetters, pathsToSkip) {
|
|
379
|
+
const paths = Object.keys(doc.$__schema.paths);
|
|
380
|
+
const plen = paths.length;
|
|
381
|
+
|
|
382
|
+
for (let i = 0; i < plen; ++i) {
|
|
383
|
+
let def;
|
|
384
|
+
let curPath = '';
|
|
385
|
+
const p = paths[i];
|
|
386
|
+
|
|
387
|
+
if (p === '_id' && skipId) {
|
|
388
|
+
continue;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
const type = doc.$__schema.paths[p];
|
|
392
|
+
const path = type.splitPath();
|
|
393
|
+
const len = path.length;
|
|
394
|
+
let included = false;
|
|
395
|
+
let doc_ = doc._doc;
|
|
396
|
+
for (let j = 0; j < len; ++j) {
|
|
397
|
+
if (doc_ == null) {
|
|
398
|
+
break;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
const piece = path[j];
|
|
402
|
+
curPath += (!curPath.length ? '' : '.') + piece;
|
|
403
|
+
|
|
404
|
+
if (exclude === true) {
|
|
405
|
+
if (curPath in fields) {
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
} else if (exclude === false && fields && !included) {
|
|
409
|
+
if (curPath in fields) {
|
|
410
|
+
included = true;
|
|
411
|
+
} else if (!hasIncludedChildren[curPath]) {
|
|
412
|
+
break;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (j === len - 1) {
|
|
417
|
+
if (doc_[piece] !== void 0) {
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if (typeof type.defaultValue === 'function') {
|
|
422
|
+
if (!type.defaultValue.$runBeforeSetters && isBeforeSetters) {
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
if (type.defaultValue.$runBeforeSetters && !isBeforeSetters) {
|
|
426
|
+
break;
|
|
427
|
+
}
|
|
428
|
+
} else if (!isBeforeSetters) {
|
|
429
|
+
// Non-function defaults should always run **before** setters
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
if (pathsToSkip && pathsToSkip[curPath]) {
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (fields && exclude !== null) {
|
|
438
|
+
if (exclude === true) {
|
|
439
|
+
// apply defaults to all non-excluded fields
|
|
440
|
+
if (p in fields) {
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
try {
|
|
445
|
+
def = type.getDefault(doc, false);
|
|
446
|
+
} catch (err) {
|
|
447
|
+
doc.invalidate(p, err);
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (typeof def !== 'undefined') {
|
|
452
|
+
doc_[piece] = def;
|
|
453
|
+
doc.$__.activePaths.default(p);
|
|
454
|
+
}
|
|
455
|
+
} else if (included) {
|
|
456
|
+
// selected field
|
|
457
|
+
try {
|
|
458
|
+
def = type.getDefault(doc, false);
|
|
459
|
+
} catch (err) {
|
|
460
|
+
doc.invalidate(p, err);
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (typeof def !== 'undefined') {
|
|
465
|
+
doc_[piece] = def;
|
|
466
|
+
doc.$__.activePaths.default(p);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
} else {
|
|
470
|
+
try {
|
|
471
|
+
def = type.getDefault(doc, false);
|
|
472
|
+
} catch (err) {
|
|
473
|
+
doc.invalidate(p, err);
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (typeof def !== 'undefined') {
|
|
478
|
+
doc_[piece] = def;
|
|
479
|
+
doc.$__.activePaths.default(p);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
} else {
|
|
483
|
+
doc_ = doc_[piece];
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* Builds the default doc structure
|
|
491
|
+
*
|
|
492
|
+
* @param {Object} obj
|
|
493
|
+
* @param {Object} [fields]
|
|
494
|
+
* @param {Boolean} [skipId]
|
|
495
|
+
* @api private
|
|
496
|
+
* @method $__buildDoc
|
|
497
|
+
* @memberOf Document
|
|
498
|
+
* @instance
|
|
499
|
+
*/
|
|
500
|
+
|
|
501
|
+
Document.prototype.$__buildDoc = function(obj, fields, skipId, exclude, hasIncludedChildren) {
|
|
502
|
+
const doc = {};
|
|
503
|
+
|
|
504
|
+
const paths = Object.keys(this.$__schema.paths).
|
|
505
|
+
// Don't build up any paths that are underneath a map, we don't know
|
|
506
|
+
// what the keys will be
|
|
507
|
+
filter(p => !p.includes('$*'));
|
|
508
|
+
const plen = paths.length;
|
|
509
|
+
let ii = 0;
|
|
510
|
+
|
|
511
|
+
for (; ii < plen; ++ii) {
|
|
512
|
+
const p = paths[ii];
|
|
513
|
+
|
|
514
|
+
if (p === '_id') {
|
|
515
|
+
if (skipId) {
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
if (obj && '_id' in obj) {
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const path = this.$__schema.paths[p].splitPath();
|
|
524
|
+
const len = path.length;
|
|
525
|
+
const last = len - 1;
|
|
526
|
+
let curPath = '';
|
|
527
|
+
let doc_ = doc;
|
|
528
|
+
let included = false;
|
|
529
|
+
|
|
530
|
+
for (let i = 0; i < len; ++i) {
|
|
531
|
+
const piece = path[i];
|
|
532
|
+
|
|
533
|
+
curPath += (!curPath.length ? '' : '.') + piece;
|
|
534
|
+
|
|
535
|
+
// support excluding intermediary levels
|
|
536
|
+
if (exclude === true) {
|
|
537
|
+
if (curPath in fields) {
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
} else if (exclude === false && fields && !included) {
|
|
541
|
+
if (curPath in fields) {
|
|
542
|
+
included = true;
|
|
543
|
+
} else if (!hasIncludedChildren[curPath]) {
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
if (i < last) {
|
|
549
|
+
doc_ = doc_[piece] || (doc_[piece] = {});
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
this._doc = doc;
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
/*!
|
|
558
|
+
* Converts to POJO when you use the document for querying
|
|
559
|
+
*/
|
|
560
|
+
|
|
561
|
+
Document.prototype.toBSON = function() {
|
|
562
|
+
return this.toObject(internalToObjectOptions);
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Initializes the document without setters or marking anything modified.
|
|
567
|
+
*
|
|
568
|
+
* Called internally after a document is returned from mongodb. Normally,
|
|
569
|
+
* you do **not** need to call this function on your own.
|
|
570
|
+
*
|
|
571
|
+
* This function triggers `init` [middleware](/docs/middleware.html).
|
|
572
|
+
* Note that `init` hooks are [synchronous](/docs/middleware.html#synchronous).
|
|
573
|
+
*
|
|
574
|
+
* @param {Object} doc document returned by mongo
|
|
575
|
+
* @api public
|
|
576
|
+
* @memberOf Document
|
|
577
|
+
* @instance
|
|
578
|
+
*/
|
|
579
|
+
|
|
580
|
+
Document.prototype.init = function(doc, opts, fn) {
|
|
581
|
+
if (typeof opts === 'function') {
|
|
582
|
+
fn = opts;
|
|
583
|
+
opts = null;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
this.$__init(doc, opts);
|
|
587
|
+
|
|
588
|
+
if (fn) {
|
|
589
|
+
fn(null, this);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return this;
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
/*!
|
|
596
|
+
* ignore
|
|
597
|
+
*/
|
|
598
|
+
|
|
599
|
+
Document.prototype.$__init = function(doc, opts) {
|
|
600
|
+
this.isNew = false;
|
|
601
|
+
this.$init = true;
|
|
602
|
+
opts = opts || {};
|
|
603
|
+
|
|
604
|
+
// handle docs with populated paths
|
|
605
|
+
// If doc._id is not null or undefined
|
|
606
|
+
if (doc._id != null && opts.populated && opts.populated.length) {
|
|
607
|
+
const id = String(doc._id);
|
|
608
|
+
for (const item of opts.populated) {
|
|
609
|
+
if (item.isVirtual) {
|
|
610
|
+
this.populated(item.path, utils.getValue(item.path, doc), item);
|
|
611
|
+
} else {
|
|
612
|
+
this.populated(item.path, item._docs[id], item);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if (item._childDocs == null) {
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
for (const child of item._childDocs) {
|
|
619
|
+
if (child == null || child.$__ == null) {
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
child.$__.parent = this;
|
|
623
|
+
}
|
|
624
|
+
item._childDocs = [];
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
init(this, doc, this._doc, opts);
|
|
629
|
+
|
|
630
|
+
markArraySubdocsPopulated(this, opts.populated);
|
|
631
|
+
|
|
632
|
+
this.emit('init', this);
|
|
633
|
+
this.constructor.emit('init', this);
|
|
634
|
+
|
|
635
|
+
this.$__._id = this._id;
|
|
636
|
+
return this;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
/*!
|
|
640
|
+
* If populating a path within a document array, make sure each
|
|
641
|
+
* subdoc within the array knows its subpaths are populated.
|
|
642
|
+
*
|
|
643
|
+
* ####Example:
|
|
644
|
+
* const doc = await Article.findOne().populate('comments.author');
|
|
645
|
+
* doc.comments[0].populated('author'); // Should be set
|
|
646
|
+
*/
|
|
647
|
+
|
|
648
|
+
function markArraySubdocsPopulated(doc, populated) {
|
|
649
|
+
if (doc._id == null || populated == null || populated.length === 0) {
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
const id = String(doc._id);
|
|
654
|
+
for (const item of populated) {
|
|
655
|
+
if (item.isVirtual) {
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
658
|
+
const path = item.path;
|
|
659
|
+
const pieces = path.split('.');
|
|
660
|
+
for (let i = 0; i < pieces.length - 1; ++i) {
|
|
661
|
+
const subpath = pieces.slice(0, i + 1).join('.');
|
|
662
|
+
const rest = pieces.slice(i + 1).join('.');
|
|
663
|
+
const val = doc.get(subpath);
|
|
664
|
+
if (val == null) {
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
if (val.isMongooseDocumentArray) {
|
|
669
|
+
for (let j = 0; j < val.length; ++j) {
|
|
670
|
+
val[j].populated(rest, item._docs[id] == null ? [] : item._docs[id][j], item);
|
|
671
|
+
}
|
|
672
|
+
break;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/*!
|
|
679
|
+
* Init helper.
|
|
680
|
+
*
|
|
681
|
+
* @param {Object} self document instance
|
|
682
|
+
* @param {Object} obj raw mongodb doc
|
|
683
|
+
* @param {Object} doc object we are initializing
|
|
684
|
+
* @api private
|
|
685
|
+
*/
|
|
686
|
+
|
|
687
|
+
function init(self, obj, doc, opts, prefix) {
|
|
688
|
+
prefix = prefix || '';
|
|
689
|
+
|
|
690
|
+
const keys = Object.keys(obj);
|
|
691
|
+
const len = keys.length;
|
|
692
|
+
let schema;
|
|
693
|
+
let path;
|
|
694
|
+
let i;
|
|
695
|
+
let index = 0;
|
|
696
|
+
|
|
697
|
+
while (index < len) {
|
|
698
|
+
_init(index++);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
function _init(index) {
|
|
702
|
+
i = keys[index];
|
|
703
|
+
path = prefix + i;
|
|
704
|
+
schema = self.$__schema.path(path);
|
|
705
|
+
|
|
706
|
+
// Should still work if not a model-level discriminator, but should not be
|
|
707
|
+
// necessary. This is *only* to catch the case where we queried using the
|
|
708
|
+
// base model and the discriminated model has a projection
|
|
709
|
+
if (self.$__schema.$isRootDiscriminator && !self.$__isSelected(path)) {
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
if (!schema && utils.isPOJO(obj[i])) {
|
|
714
|
+
// assume nested object
|
|
715
|
+
if (!doc[i]) {
|
|
716
|
+
doc[i] = {};
|
|
717
|
+
}
|
|
718
|
+
init(self, obj[i], doc[i], opts, path + '.');
|
|
719
|
+
} else if (!schema) {
|
|
720
|
+
doc[i] = obj[i];
|
|
721
|
+
} else {
|
|
722
|
+
if (obj[i] === null) {
|
|
723
|
+
doc[i] = schema._castNullish(null);
|
|
724
|
+
} else if (obj[i] !== undefined) {
|
|
725
|
+
const intCache = obj[i].$__ || {};
|
|
726
|
+
const wasPopulated = intCache.wasPopulated || null;
|
|
727
|
+
|
|
728
|
+
if (schema && !wasPopulated) {
|
|
729
|
+
try {
|
|
730
|
+
doc[i] = schema.cast(obj[i], self, true);
|
|
731
|
+
} catch (e) {
|
|
732
|
+
self.invalidate(e.path, new validator({
|
|
733
|
+
path: e.path,
|
|
734
|
+
message: e.message,
|
|
735
|
+
type: 'cast',
|
|
736
|
+
value: e.value,
|
|
737
|
+
reason: e
|
|
738
|
+
}));
|
|
739
|
+
}
|
|
740
|
+
} else {
|
|
741
|
+
doc[i] = obj[i];
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
// mark as hydrated
|
|
745
|
+
if (!self.isModified(path)) {
|
|
746
|
+
self.$__.activePaths.init(path);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Sends an update command with this document `_id` as the query selector.
|
|
754
|
+
*
|
|
755
|
+
* ####Example:
|
|
756
|
+
*
|
|
757
|
+
* weirdCar.update({$inc: {wheels:1}}, { w: 1 }, callback);
|
|
758
|
+
*
|
|
759
|
+
* ####Valid options:
|
|
760
|
+
*
|
|
761
|
+
* - same as in [Model.update](#model_Model.update)
|
|
762
|
+
*
|
|
763
|
+
* @see Model.update #model_Model.update
|
|
764
|
+
* @param {Object} doc
|
|
765
|
+
* @param {Object} options
|
|
766
|
+
* @param {Function} callback
|
|
767
|
+
* @return {Query}
|
|
768
|
+
* @api public
|
|
769
|
+
* @memberOf Document
|
|
770
|
+
* @instance
|
|
771
|
+
*/
|
|
772
|
+
|
|
773
|
+
Document.prototype.update = function update() {
|
|
774
|
+
const args = utils.args(arguments);
|
|
775
|
+
args.unshift({ _id: this._id });
|
|
776
|
+
const query = this.constructor.update.apply(this.constructor, args);
|
|
777
|
+
|
|
778
|
+
if (this.$session() != null) {
|
|
779
|
+
if (!('session' in query.options)) {
|
|
780
|
+
query.options.session = this.$session();
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
return query;
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Sends an updateOne command with this document `_id` as the query selector.
|
|
789
|
+
*
|
|
790
|
+
* ####Example:
|
|
791
|
+
*
|
|
792
|
+
* weirdCar.updateOne({$inc: {wheels:1}}, { w: 1 }, callback);
|
|
793
|
+
*
|
|
794
|
+
* ####Valid options:
|
|
795
|
+
*
|
|
796
|
+
* - same as in [Model.updateOne](#model_Model.updateOne)
|
|
797
|
+
*
|
|
798
|
+
* @see Model.updateOne #model_Model.updateOne
|
|
799
|
+
* @param {Object} doc
|
|
800
|
+
* @param {Object} [options] optional see [`Query.prototype.setOptions()`](http://mongoosejs.com/docs/api.html#query_Query-setOptions)
|
|
801
|
+
* @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](/docs/api.html#query_Query-lean) and the [Mongoose lean tutorial](/docs/tutorials/lean.html).
|
|
802
|
+
* @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](http://mongoosejs.com/docs/guide.html#strict)
|
|
803
|
+
* @param {Boolean} [options.omitUndefined=false] If true, delete any properties whose value is `undefined` when casting an update. In other words, if this is set, Mongoose will delete `baz` from the update in `Model.updateOne({}, { foo: 'bar', baz: undefined })` before sending the update to the server.
|
|
804
|
+
* @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set.
|
|
805
|
+
* @param {Function} callback
|
|
806
|
+
* @return {Query}
|
|
807
|
+
* @api public
|
|
808
|
+
* @memberOf Document
|
|
809
|
+
* @instance
|
|
810
|
+
*/
|
|
811
|
+
|
|
812
|
+
Document.prototype.updateOne = function updateOne(doc, options, callback) {
|
|
813
|
+
const query = this.constructor.updateOne({ _id: this._id }, doc, options);
|
|
814
|
+
query.pre(cb => {
|
|
815
|
+
this.constructor._middleware.execPre('updateOne', this, [this], cb);
|
|
816
|
+
});
|
|
817
|
+
query.post(cb => {
|
|
818
|
+
this.constructor._middleware.execPost('updateOne', this, [this], {}, cb);
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
if (this.$session() != null) {
|
|
822
|
+
if (!('session' in query.options)) {
|
|
823
|
+
query.options.session = this.$session();
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
if (callback != null) {
|
|
828
|
+
return query.exec(callback);
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
return query;
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Sends a replaceOne command with this document `_id` as the query selector.
|
|
836
|
+
*
|
|
837
|
+
* ####Valid options:
|
|
838
|
+
*
|
|
839
|
+
* - same as in [Model.replaceOne](https://mongoosejs.com/docs/api/model.html#model_Model.replaceOne)
|
|
840
|
+
*
|
|
841
|
+
* @see Model.replaceOne #model_Model.replaceOne
|
|
842
|
+
* @param {Object} doc
|
|
843
|
+
* @param {Object} options
|
|
844
|
+
* @param {Function} callback
|
|
845
|
+
* @return {Query}
|
|
846
|
+
* @api public
|
|
847
|
+
* @memberOf Document
|
|
848
|
+
* @instance
|
|
849
|
+
*/
|
|
850
|
+
|
|
851
|
+
Document.prototype.replaceOne = function replaceOne() {
|
|
852
|
+
const args = utils.args(arguments);
|
|
853
|
+
args.unshift({ _id: this._id });
|
|
854
|
+
return this.constructor.replaceOne.apply(this.constructor, args);
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Getter/setter around the session associated with this document. Used to
|
|
859
|
+
* automatically set `session` if you `save()` a doc that you got from a
|
|
860
|
+
* query with an associated session.
|
|
861
|
+
*
|
|
862
|
+
* ####Example:
|
|
863
|
+
*
|
|
864
|
+
* const session = MyModel.startSession();
|
|
865
|
+
* const doc = await MyModel.findOne().session(session);
|
|
866
|
+
* doc.$session() === session; // true
|
|
867
|
+
* doc.$session(null);
|
|
868
|
+
* doc.$session() === null; // true
|
|
869
|
+
*
|
|
870
|
+
* If this is a top-level document, setting the session propagates to all child
|
|
871
|
+
* docs.
|
|
872
|
+
*
|
|
873
|
+
* @param {ClientSession} [session] overwrite the current session
|
|
874
|
+
* @return {ClientSession}
|
|
875
|
+
* @method $session
|
|
876
|
+
* @api public
|
|
877
|
+
* @memberOf Document
|
|
878
|
+
*/
|
|
879
|
+
|
|
880
|
+
Document.prototype.$session = function $session(session) {
|
|
881
|
+
if (arguments.length === 0) {
|
|
882
|
+
if (this.$__.session != null && this.$__.session.hasEnded) {
|
|
883
|
+
this.$__.session = null;
|
|
884
|
+
return null;
|
|
885
|
+
}
|
|
886
|
+
return this.$__.session;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
if (session != null && session.hasEnded) {
|
|
890
|
+
throw new error('Cannot set a document\'s session to a session that has ended. Make sure you haven\'t ' +
|
|
891
|
+
'called `endSession()` on the session you are passing to `$session()`.');
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
this.$__.session = session;
|
|
895
|
+
|
|
896
|
+
if (!this.ownerDocument) {
|
|
897
|
+
const subdocs = this.$getAllSubdocs();
|
|
898
|
+
for (const child of subdocs) {
|
|
899
|
+
child.$session(session);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
return session;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Overwrite all values in this document with the values of `obj`, except
|
|
908
|
+
* for immutable properties. Behaves similarly to `set()`, except for it
|
|
909
|
+
* unsets all properties that aren't in `obj`.
|
|
910
|
+
*
|
|
911
|
+
* @param {Object} obj the object to overwrite this document with
|
|
912
|
+
* @method overwrite
|
|
913
|
+
* @name overwrite
|
|
914
|
+
* @memberOf Document
|
|
915
|
+
* @instance
|
|
916
|
+
* @api public
|
|
917
|
+
*/
|
|
918
|
+
|
|
919
|
+
Document.prototype.overwrite = function overwrite(obj) {
|
|
920
|
+
const keys = Array.from(new Set(Object.keys(this._doc).concat(Object.keys(obj))));
|
|
921
|
+
|
|
922
|
+
for (const key of keys) {
|
|
923
|
+
if (key === '_id') {
|
|
924
|
+
continue;
|
|
925
|
+
}
|
|
926
|
+
// Explicitly skip version key
|
|
927
|
+
if (this.$__schema.options.versionKey && key === this.$__schema.options.versionKey) {
|
|
928
|
+
continue;
|
|
929
|
+
}
|
|
930
|
+
if (this.$__schema.options.discriminatorKey && key === this.$__schema.options.discriminatorKey) {
|
|
931
|
+
continue;
|
|
932
|
+
}
|
|
933
|
+
this.$set(key, obj[key]);
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
return this;
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Alias for `set()`, used internally to avoid conflicts
|
|
941
|
+
*
|
|
942
|
+
* @param {String|Object} path path or object of key/vals to set
|
|
943
|
+
* @param {Any} val the value to set
|
|
944
|
+
* @param {Schema|String|Number|Buffer|*} [type] optionally specify a type for "on-the-fly" attributes
|
|
945
|
+
* @param {Object} [options] optionally specify options that modify the behavior of the set
|
|
946
|
+
* @method $set
|
|
947
|
+
* @name $set
|
|
948
|
+
* @memberOf Document
|
|
949
|
+
* @instance
|
|
950
|
+
* @api public
|
|
951
|
+
*/
|
|
952
|
+
|
|
953
|
+
Document.prototype.$set = function $set(path, val, type, options) {
|
|
954
|
+
if (utils.isPOJO(type)) {
|
|
955
|
+
options = type;
|
|
956
|
+
type = undefined;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
options = options || {};
|
|
960
|
+
const merge = options.merge;
|
|
961
|
+
const adhoc = type && type !== true;
|
|
962
|
+
const constructing = type === true;
|
|
963
|
+
const typeKey = this.$__schema.options.typeKey;
|
|
964
|
+
let adhocs;
|
|
965
|
+
let keys;
|
|
966
|
+
let i = 0;
|
|
967
|
+
let pathtype;
|
|
968
|
+
let key;
|
|
969
|
+
let prefix;
|
|
970
|
+
|
|
971
|
+
const strict$1 = 'strict' in options
|
|
972
|
+
? options.strict
|
|
973
|
+
: this.$__.strictMode;
|
|
974
|
+
|
|
975
|
+
if (adhoc) {
|
|
976
|
+
adhocs = this.$__.adhocPaths || (this.$__.adhocPaths = {});
|
|
977
|
+
adhocs[path] = this.$__schema.interpretAsType(path, type, this.$__schema.options);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
if (path == null) {
|
|
981
|
+
const _ = path;
|
|
982
|
+
path = val;
|
|
983
|
+
val = _;
|
|
984
|
+
} else if (typeof path !== 'string') {
|
|
985
|
+
// new Document({ key: val })
|
|
986
|
+
if (path instanceof Document) {
|
|
987
|
+
if (path.$__isNested) {
|
|
988
|
+
path = path.toObject();
|
|
989
|
+
} else {
|
|
990
|
+
path = path._doc;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
if (path == null) {
|
|
994
|
+
const _ = path;
|
|
995
|
+
path = val;
|
|
996
|
+
val = _;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
prefix = val ? val + '.' : '';
|
|
1000
|
+
keys = Object.keys(path);
|
|
1001
|
+
const len = keys.length;
|
|
1002
|
+
|
|
1003
|
+
// `_skipMinimizeTopLevel` is because we may have deleted the top-level
|
|
1004
|
+
// nested key to ensure key order.
|
|
1005
|
+
const _skipMinimizeTopLevel = get(options, '_skipMinimizeTopLevel', false);
|
|
1006
|
+
if (len === 0 && _skipMinimizeTopLevel) {
|
|
1007
|
+
delete options._skipMinimizeTopLevel;
|
|
1008
|
+
if (val) {
|
|
1009
|
+
this.$set(val, {});
|
|
1010
|
+
}
|
|
1011
|
+
return this;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
for (let i = 0; i < len; ++i) {
|
|
1015
|
+
key = keys[i];
|
|
1016
|
+
const pathName = prefix + key;
|
|
1017
|
+
pathtype = this.$__schema.pathType(pathName);
|
|
1018
|
+
|
|
1019
|
+
// On initial set, delete any nested keys if we're going to overwrite
|
|
1020
|
+
// them to ensure we keep the user's key order.
|
|
1021
|
+
if (type === true &&
|
|
1022
|
+
!prefix &&
|
|
1023
|
+
path[key] != null &&
|
|
1024
|
+
pathtype === 'nested' &&
|
|
1025
|
+
this._doc[key] != null &&
|
|
1026
|
+
Object.keys(this._doc[key]).length === 0) {
|
|
1027
|
+
delete this._doc[key];
|
|
1028
|
+
// Make sure we set `{}` back even if we minimize re: gh-8565
|
|
1029
|
+
options = Object.assign({}, options, { _skipMinimizeTopLevel: true });
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
const someCondition = typeof path[key] === 'object' &&
|
|
1033
|
+
!utils.isNativeObject(path[key]) &&
|
|
1034
|
+
!utils.isMongooseType(path[key]) &&
|
|
1035
|
+
path[key] != null &&
|
|
1036
|
+
pathtype !== 'virtual' &&
|
|
1037
|
+
pathtype !== 'real' &&
|
|
1038
|
+
pathtype !== 'adhocOrUndefined' &&
|
|
1039
|
+
!(this.$__path(pathName) instanceof mixed) &&
|
|
1040
|
+
!(this.$__schema.paths[pathName] &&
|
|
1041
|
+
this.$__schema.paths[pathName].options &&
|
|
1042
|
+
this.$__schema.paths[pathName].options.ref);
|
|
1043
|
+
|
|
1044
|
+
if (someCondition) {
|
|
1045
|
+
this.$__.$setCalled.add(prefix + key);
|
|
1046
|
+
this.$set(path[key], prefix + key, constructing, options);
|
|
1047
|
+
} else if (strict$1) {
|
|
1048
|
+
// Don't overwrite defaults with undefined keys (gh-3981) (gh-9039)
|
|
1049
|
+
if (constructing && path[key] === void 0 &&
|
|
1050
|
+
this.get(pathName) !== void 0) {
|
|
1051
|
+
continue;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if (pathtype === 'adhocOrUndefined') {
|
|
1055
|
+
pathtype = getEmbeddedDiscriminatorPath(this, pathName, { typeOnly: true });
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
if (pathtype === 'real' || pathtype === 'virtual') {
|
|
1059
|
+
// Check for setting single embedded schema to document (gh-3535)
|
|
1060
|
+
let p = path[key];
|
|
1061
|
+
if (this.$__schema.paths[pathName] &&
|
|
1062
|
+
this.$__schema.paths[pathName].$isSingleNested &&
|
|
1063
|
+
path[key] instanceof Document) {
|
|
1064
|
+
p = p.toObject({ virtuals: false, transform: false });
|
|
1065
|
+
}
|
|
1066
|
+
this.$set(prefix + key, p, constructing, options);
|
|
1067
|
+
} else if (pathtype === 'nested' && path[key] instanceof Document) {
|
|
1068
|
+
this.$set(prefix + key,
|
|
1069
|
+
path[key].toObject({ transform: false }), constructing, options);
|
|
1070
|
+
} else if (strict$1 === 'throw') {
|
|
1071
|
+
if (pathtype === 'nested') {
|
|
1072
|
+
throw new objectExpected(key, path[key]);
|
|
1073
|
+
} else {
|
|
1074
|
+
throw new strict(key);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
} else if (path[key] !== void 0) {
|
|
1078
|
+
this.$set(prefix + key, path[key], constructing, options);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
return this;
|
|
1083
|
+
} else {
|
|
1084
|
+
this.$__.$setCalled.add(path);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
let pathType = this.$__schema.pathType(path);
|
|
1088
|
+
if (pathType === 'adhocOrUndefined') {
|
|
1089
|
+
pathType = getEmbeddedDiscriminatorPath(this, path, { typeOnly: true });
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
// Assume this is a Mongoose document that was copied into a POJO using
|
|
1093
|
+
// `Object.assign()` or `{...doc}`
|
|
1094
|
+
val = handleSpreadDoc(val);
|
|
1095
|
+
|
|
1096
|
+
if (pathType === 'nested' && val) {
|
|
1097
|
+
if (typeof val === 'object' && val != null) {
|
|
1098
|
+
const hasPriorVal = this.$__.savedState != null && this.$__.savedState.hasOwnProperty(path);
|
|
1099
|
+
if (this.$__.savedState != null && !this.isNew && !this.$__.savedState.hasOwnProperty(path)) {
|
|
1100
|
+
const priorVal = this.$__getValue(path);
|
|
1101
|
+
this.$__.savedState[path] = priorVal;
|
|
1102
|
+
|
|
1103
|
+
const keys = Object.keys(priorVal || {});
|
|
1104
|
+
for (const key of keys) {
|
|
1105
|
+
this.$__.savedState[path + '.' + key] = priorVal[key];
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
if (!merge) {
|
|
1110
|
+
this.$__setValue(path, null);
|
|
1111
|
+
cleanModifiedSubpaths(this, path);
|
|
1112
|
+
} else {
|
|
1113
|
+
return this.$set(val, path, constructing);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
const keys = Object.keys(val);
|
|
1117
|
+
this.$__setValue(path, {});
|
|
1118
|
+
for (const key of keys) {
|
|
1119
|
+
this.$set(path + '.' + key, val[key], constructing);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
if (hasPriorVal && utils.deepEqual(this.$__.savedState[path], val)) {
|
|
1123
|
+
this.unmarkModified(path);
|
|
1124
|
+
} else {
|
|
1125
|
+
this.markModified(path);
|
|
1126
|
+
}
|
|
1127
|
+
cleanModifiedSubpaths(this, path, { skipDocArrays: true });
|
|
1128
|
+
return this;
|
|
1129
|
+
}
|
|
1130
|
+
this.invalidate(path, new error.CastError('Object', val, path));
|
|
1131
|
+
return this;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
let schema;
|
|
1135
|
+
const parts = path.indexOf('.') === -1 ? [path] : path.split('.');
|
|
1136
|
+
|
|
1137
|
+
// Might need to change path for top-level alias
|
|
1138
|
+
if (typeof this.$__schema.aliases[parts[0]] == 'string') {
|
|
1139
|
+
parts[0] = this.$__schema.aliases[parts[0]];
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
if (pathType === 'adhocOrUndefined' && strict$1) {
|
|
1143
|
+
// check for roots that are Mixed types
|
|
1144
|
+
let mixed$1;
|
|
1145
|
+
|
|
1146
|
+
for (i = 0; i < parts.length; ++i) {
|
|
1147
|
+
const subpath = parts.slice(0, i + 1).join('.');
|
|
1148
|
+
|
|
1149
|
+
// If path is underneath a virtual, bypass everything and just set it.
|
|
1150
|
+
if (i + 1 < parts.length && this.$__schema.pathType(subpath) === 'virtual') {
|
|
1151
|
+
mpath.set(path, val, this);
|
|
1152
|
+
return this;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
schema = this.$__schema.path(subpath);
|
|
1156
|
+
if (schema == null) {
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
if (schema instanceof mixed) {
|
|
1161
|
+
// allow changes to sub paths of mixed types
|
|
1162
|
+
mixed$1 = true;
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
if (schema == null) {
|
|
1168
|
+
// Check for embedded discriminators
|
|
1169
|
+
schema = getEmbeddedDiscriminatorPath(this, path);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
if (!mixed$1 && !schema) {
|
|
1173
|
+
if (strict$1 === 'throw') {
|
|
1174
|
+
throw new strict(path);
|
|
1175
|
+
}
|
|
1176
|
+
return this;
|
|
1177
|
+
}
|
|
1178
|
+
} else if (pathType === 'virtual') {
|
|
1179
|
+
schema = this.$__schema.virtualpath(path);
|
|
1180
|
+
schema.applySetters(val, this);
|
|
1181
|
+
return this;
|
|
1182
|
+
} else {
|
|
1183
|
+
schema = this.$__path(path);
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
// gh-4578, if setting a deeply nested path that doesn't exist yet, create it
|
|
1187
|
+
let cur = this._doc;
|
|
1188
|
+
let curPath = '';
|
|
1189
|
+
for (i = 0; i < parts.length - 1; ++i) {
|
|
1190
|
+
cur = cur[parts[i]];
|
|
1191
|
+
curPath += (curPath.length > 0 ? '.' : '') + parts[i];
|
|
1192
|
+
if (!cur) {
|
|
1193
|
+
this.$set(curPath, {});
|
|
1194
|
+
// Hack re: gh-5800. If nested field is not selected, it probably exists
|
|
1195
|
+
// so `MongoError: cannot use the part (nested of nested.num) to
|
|
1196
|
+
// traverse the element ({nested: null})` is not likely. If user gets
|
|
1197
|
+
// that error, its their fault for now. We should reconsider disallowing
|
|
1198
|
+
// modifying not selected paths for 6.x
|
|
1199
|
+
if (!this.$__isSelected(curPath)) {
|
|
1200
|
+
this.unmarkModified(curPath);
|
|
1201
|
+
}
|
|
1202
|
+
cur = this.$__getValue(curPath);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
let pathToMark;
|
|
1207
|
+
|
|
1208
|
+
// When using the $set operator the path to the field must already exist.
|
|
1209
|
+
// Else mongodb throws: "LEFT_SUBFIELD only supports Object"
|
|
1210
|
+
|
|
1211
|
+
if (parts.length <= 1) {
|
|
1212
|
+
pathToMark = path;
|
|
1213
|
+
} else {
|
|
1214
|
+
for (i = 0; i < parts.length; ++i) {
|
|
1215
|
+
const subpath = parts.slice(0, i + 1).join('.');
|
|
1216
|
+
if (this.get(subpath, null, { getters: false }) === null) {
|
|
1217
|
+
pathToMark = subpath;
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
if (!pathToMark) {
|
|
1223
|
+
pathToMark = path;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
// if this doc is being constructed we should not trigger getters
|
|
1228
|
+
const priorVal = (() => {
|
|
1229
|
+
if (this.$__.$options.priorDoc != null) {
|
|
1230
|
+
return this.$__.$options.priorDoc.$__getValue(path);
|
|
1231
|
+
}
|
|
1232
|
+
if (constructing) {
|
|
1233
|
+
return void 0;
|
|
1234
|
+
}
|
|
1235
|
+
return this.$__getValue(path);
|
|
1236
|
+
})();
|
|
1237
|
+
|
|
1238
|
+
if (!schema) {
|
|
1239
|
+
this.$__set(pathToMark, path, constructing, parts, schema, val, priorVal);
|
|
1240
|
+
return this;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
// If overwriting a subdocument path, make sure to clear out
|
|
1244
|
+
// any errors _before_ setting, so new errors that happen
|
|
1245
|
+
// get persisted. Re: #9080
|
|
1246
|
+
if (schema.$isSingleNested || schema.$isMongooseArray) {
|
|
1247
|
+
_markValidSubpaths(this, path);
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
if (schema.$isSingleNested && val != null && merge) {
|
|
1251
|
+
if (val instanceof Document) {
|
|
1252
|
+
val = val.toObject({ virtuals: false, transform: false });
|
|
1253
|
+
}
|
|
1254
|
+
const keys = Object.keys(val);
|
|
1255
|
+
for (const key of keys) {
|
|
1256
|
+
this.$set(path + '.' + key, val[key], constructing, options);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
return this;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
let shouldSet = true;
|
|
1263
|
+
try {
|
|
1264
|
+
// If the user is trying to set a ref path to a document with
|
|
1265
|
+
// the correct model name, treat it as populated
|
|
1266
|
+
const refMatches = (() => {
|
|
1267
|
+
if (schema.options == null) {
|
|
1268
|
+
return false;
|
|
1269
|
+
}
|
|
1270
|
+
if (!(val instanceof Document)) {
|
|
1271
|
+
return false;
|
|
1272
|
+
}
|
|
1273
|
+
const model = val.constructor;
|
|
1274
|
+
|
|
1275
|
+
// Check ref
|
|
1276
|
+
const ref = schema.options.ref;
|
|
1277
|
+
if (ref != null && (ref === model.modelName || ref === model.baseModelName)) {
|
|
1278
|
+
return true;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
// Check refPath
|
|
1282
|
+
const refPath = schema.options.refPath;
|
|
1283
|
+
if (refPath == null) {
|
|
1284
|
+
return false;
|
|
1285
|
+
}
|
|
1286
|
+
const modelName = val.get(refPath);
|
|
1287
|
+
return modelName === model.modelName || modelName === model.baseModelName;
|
|
1288
|
+
})();
|
|
1289
|
+
|
|
1290
|
+
let didPopulate = false;
|
|
1291
|
+
if (refMatches && val instanceof Document) {
|
|
1292
|
+
this.populated(path, val._id, { [populateModelSymbol]: val.constructor });
|
|
1293
|
+
val.$__.wasPopulated = true;
|
|
1294
|
+
didPopulate = true;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
let popOpts;
|
|
1298
|
+
if (schema.options &&
|
|
1299
|
+
Array.isArray(schema.options[typeKey]) &&
|
|
1300
|
+
schema.options[typeKey].length &&
|
|
1301
|
+
schema.options[typeKey][0].ref &&
|
|
1302
|
+
_isManuallyPopulatedArray(val, schema.options[typeKey][0].ref)) {
|
|
1303
|
+
popOpts = { [populateModelSymbol]: val[0].constructor };
|
|
1304
|
+
this.populated(path, val.map(function(v) { return v._id; }), popOpts);
|
|
1305
|
+
|
|
1306
|
+
for (const doc of val) {
|
|
1307
|
+
doc.$__.wasPopulated = true;
|
|
1308
|
+
}
|
|
1309
|
+
didPopulate = true;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
if (this.$__schema.singleNestedPaths[path] == null) {
|
|
1313
|
+
// If this path is underneath a single nested schema, we'll call the setter
|
|
1314
|
+
// later in `$__set()` because we don't take `_doc` when we iterate through
|
|
1315
|
+
// a single nested doc. That's to make sure we get the correct context.
|
|
1316
|
+
// Otherwise we would double-call the setter, see gh-7196.
|
|
1317
|
+
val = schema.applySetters(val, this, false, priorVal);
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
if (schema.$isMongooseDocumentArray &&
|
|
1321
|
+
Array.isArray(val) &&
|
|
1322
|
+
val.length > 0 &&
|
|
1323
|
+
val[0] != null &&
|
|
1324
|
+
val[0].$__ != null &&
|
|
1325
|
+
val[0].$__.populated != null) {
|
|
1326
|
+
const populatedPaths = Object.keys(val[0].$__.populated);
|
|
1327
|
+
for (const populatedPath of populatedPaths) {
|
|
1328
|
+
this.populated(path + '.' + populatedPath,
|
|
1329
|
+
val.map(v => v.populated(populatedPath)),
|
|
1330
|
+
val[0].$__.populated[populatedPath].options);
|
|
1331
|
+
}
|
|
1332
|
+
didPopulate = true;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
if (!didPopulate && this.$__.populated) {
|
|
1336
|
+
// If this array partially contains populated documents, convert them
|
|
1337
|
+
// all to ObjectIds re: #8443
|
|
1338
|
+
if (Array.isArray(val) && this.$__.populated[path]) {
|
|
1339
|
+
for (let i = 0; i < val.length; ++i) {
|
|
1340
|
+
if (val[i] instanceof Document) {
|
|
1341
|
+
val[i] = val[i]._id;
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
delete this.$__.populated[path];
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
if (schema.$isSingleNested && val != null) {
|
|
1349
|
+
_checkImmutableSubpaths(val, schema, priorVal);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
this.$markValid(path);
|
|
1353
|
+
} catch (e) {
|
|
1354
|
+
if (e instanceof error.StrictModeError && e.isImmutableError) {
|
|
1355
|
+
this.invalidate(path, e);
|
|
1356
|
+
} else if (e instanceof error.CastError) {
|
|
1357
|
+
this.invalidate(e.path, e);
|
|
1358
|
+
if (e.$originalErrorPath) {
|
|
1359
|
+
this.invalidate(path,
|
|
1360
|
+
new error.CastError(schema.instance, val, path, e.$originalErrorPath));
|
|
1361
|
+
}
|
|
1362
|
+
} else {
|
|
1363
|
+
this.invalidate(path,
|
|
1364
|
+
new error.CastError(schema.instance, val, path, e));
|
|
1365
|
+
}
|
|
1366
|
+
shouldSet = false;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
if (shouldSet) {
|
|
1370
|
+
this.$__set(pathToMark, path, constructing, parts, schema, val, priorVal);
|
|
1371
|
+
|
|
1372
|
+
if (this.$__.savedState != null) {
|
|
1373
|
+
if (!this.isNew && !this.$__.savedState.hasOwnProperty(path)) {
|
|
1374
|
+
this.$__.savedState[path] = priorVal;
|
|
1375
|
+
} else if (this.$__.savedState.hasOwnProperty(path) && utils.deepEqual(val, this.$__.savedState[path])) {
|
|
1376
|
+
this.unmarkModified(path);
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
if (schema.$isSingleNested && (this.isDirectModified(path) || val == null)) {
|
|
1382
|
+
cleanModifiedSubpaths(this, path);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
return this;
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
/*!
|
|
1389
|
+
* ignore
|
|
1390
|
+
*/
|
|
1391
|
+
|
|
1392
|
+
function _isManuallyPopulatedArray(val, ref) {
|
|
1393
|
+
if (!Array.isArray(val)) {
|
|
1394
|
+
return false;
|
|
1395
|
+
}
|
|
1396
|
+
if (val.length === 0) {
|
|
1397
|
+
return false;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
for (const el of val) {
|
|
1401
|
+
if (!(el instanceof Document)) {
|
|
1402
|
+
return false;
|
|
1403
|
+
}
|
|
1404
|
+
const modelName = el.constructor.modelName;
|
|
1405
|
+
if (modelName == null) {
|
|
1406
|
+
return false;
|
|
1407
|
+
}
|
|
1408
|
+
if (el.constructor.modelName != ref && el.constructor.baseModelName != ref) {
|
|
1409
|
+
return false;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
return true;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Sets the value of a path, or many paths.
|
|
1418
|
+
*
|
|
1419
|
+
* ####Example:
|
|
1420
|
+
*
|
|
1421
|
+
* // path, value
|
|
1422
|
+
* doc.set(path, value)
|
|
1423
|
+
*
|
|
1424
|
+
* // object
|
|
1425
|
+
* doc.set({
|
|
1426
|
+
* path : value
|
|
1427
|
+
* , path2 : {
|
|
1428
|
+
* path : value
|
|
1429
|
+
* }
|
|
1430
|
+
* })
|
|
1431
|
+
*
|
|
1432
|
+
* // on-the-fly cast to number
|
|
1433
|
+
* doc.set(path, value, Number)
|
|
1434
|
+
*
|
|
1435
|
+
* // on-the-fly cast to string
|
|
1436
|
+
* doc.set(path, value, String)
|
|
1437
|
+
*
|
|
1438
|
+
* // changing strict mode behavior
|
|
1439
|
+
* doc.set(path, value, { strict: false });
|
|
1440
|
+
*
|
|
1441
|
+
* @param {String|Object} path path or object of key/vals to set
|
|
1442
|
+
* @param {Any} val the value to set
|
|
1443
|
+
* @param {Schema|String|Number|Buffer|*} [type] optionally specify a type for "on-the-fly" attributes
|
|
1444
|
+
* @param {Object} [options] optionally specify options that modify the behavior of the set
|
|
1445
|
+
* @api public
|
|
1446
|
+
* @method set
|
|
1447
|
+
* @memberOf Document
|
|
1448
|
+
* @instance
|
|
1449
|
+
*/
|
|
1450
|
+
|
|
1451
|
+
Document.prototype.set = Document.prototype.$set;
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Determine if we should mark this change as modified.
|
|
1455
|
+
*
|
|
1456
|
+
* @return {Boolean}
|
|
1457
|
+
* @api private
|
|
1458
|
+
* @method $__shouldModify
|
|
1459
|
+
* @memberOf Document
|
|
1460
|
+
* @instance
|
|
1461
|
+
*/
|
|
1462
|
+
|
|
1463
|
+
Document.prototype.$__shouldModify = function(pathToMark, path, constructing, parts, schema, val, priorVal) {
|
|
1464
|
+
if (this.isNew) {
|
|
1465
|
+
return true;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
// Re: the note about gh-7196, `val` is the raw value without casting or
|
|
1469
|
+
// setters if the full path is under a single nested subdoc because we don't
|
|
1470
|
+
// want to double run setters. So don't set it as modified. See gh-7264.
|
|
1471
|
+
if (this.$__schema.singleNestedPaths[path] != null) {
|
|
1472
|
+
return false;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
if (val === void 0 && !this.$__isSelected(path)) {
|
|
1476
|
+
// when a path is not selected in a query, its initial
|
|
1477
|
+
// value will be undefined.
|
|
1478
|
+
return true;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
if (val === void 0 && path in this.$__.activePaths.states.default) {
|
|
1482
|
+
// we're just unsetting the default value which was never saved
|
|
1483
|
+
return false;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
// gh-3992: if setting a populated field to a doc, don't mark modified
|
|
1487
|
+
// if they have the same _id
|
|
1488
|
+
if (this.populated(path) &&
|
|
1489
|
+
val instanceof Document &&
|
|
1490
|
+
deepEqual(val._id, priorVal)) {
|
|
1491
|
+
return false;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
if (!deepEqual(val, priorVal || utils.getValue(path, this))) {
|
|
1495
|
+
return true;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
if (!constructing &&
|
|
1499
|
+
val !== null &&
|
|
1500
|
+
val !== undefined &&
|
|
1501
|
+
path in this.$__.activePaths.states.default &&
|
|
1502
|
+
deepEqual(val, schema.getDefault(this, constructing))) {
|
|
1503
|
+
// a path with a default was $unset on the server
|
|
1504
|
+
// and the user is setting it to the same value again
|
|
1505
|
+
return true;
|
|
1506
|
+
}
|
|
1507
|
+
return false;
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
/**
|
|
1511
|
+
* Handles the actual setting of the value and marking the path modified if appropriate.
|
|
1512
|
+
*
|
|
1513
|
+
* @api private
|
|
1514
|
+
* @method $__set
|
|
1515
|
+
* @memberOf Document
|
|
1516
|
+
* @instance
|
|
1517
|
+
*/
|
|
1518
|
+
|
|
1519
|
+
Document.prototype.$__set = function(pathToMark, path, constructing, parts, schema, val, priorVal) {
|
|
1520
|
+
Embedded = Embedded || embedded;
|
|
1521
|
+
|
|
1522
|
+
const shouldModify = this.$__shouldModify(pathToMark, path, constructing, parts,
|
|
1523
|
+
schema, val, priorVal);
|
|
1524
|
+
const _this = this;
|
|
1525
|
+
|
|
1526
|
+
if (shouldModify) {
|
|
1527
|
+
this.markModified(pathToMark);
|
|
1528
|
+
if (val && val.isMongooseArray) {
|
|
1529
|
+
val._registerAtomic('$set', val);
|
|
1530
|
+
|
|
1531
|
+
// Update embedded document parent references (gh-5189)
|
|
1532
|
+
if (val.isMongooseDocumentArray) {
|
|
1533
|
+
val.forEach(function(item) {
|
|
1534
|
+
item && item.__parentArray && (item.__parentArray = val);
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
// Small hack for gh-1638: if we're overwriting the entire array, ignore
|
|
1539
|
+
// paths that were modified before the array overwrite
|
|
1540
|
+
this.$__.activePaths.forEach(function(modifiedPath) {
|
|
1541
|
+
if (modifiedPath.startsWith(path + '.')) {
|
|
1542
|
+
_this.$__.activePaths.ignore(modifiedPath);
|
|
1543
|
+
}
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
let obj = this._doc;
|
|
1549
|
+
let i = 0;
|
|
1550
|
+
const l = parts.length;
|
|
1551
|
+
let cur = '';
|
|
1552
|
+
|
|
1553
|
+
for (; i < l; i++) {
|
|
1554
|
+
const next = i + 1;
|
|
1555
|
+
const last = next === l;
|
|
1556
|
+
cur += (cur ? '.' + parts[i] : parts[i]);
|
|
1557
|
+
if (specialProperties.has(parts[i])) {
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
if (last) {
|
|
1562
|
+
if (obj instanceof Map) {
|
|
1563
|
+
obj.set(parts[i], val);
|
|
1564
|
+
} else {
|
|
1565
|
+
obj[parts[i]] = val;
|
|
1566
|
+
}
|
|
1567
|
+
} else {
|
|
1568
|
+
if (utils.isPOJO(obj[parts[i]])) {
|
|
1569
|
+
obj = obj[parts[i]];
|
|
1570
|
+
} else if (obj[parts[i]] && obj[parts[i]] instanceof Embedded) {
|
|
1571
|
+
obj = obj[parts[i]];
|
|
1572
|
+
} else if (obj[parts[i]] && obj[parts[i]].$isSingleNested) {
|
|
1573
|
+
obj = obj[parts[i]];
|
|
1574
|
+
} else if (obj[parts[i]] && Array.isArray(obj[parts[i]])) {
|
|
1575
|
+
obj = obj[parts[i]];
|
|
1576
|
+
} else {
|
|
1577
|
+
obj[parts[i]] = obj[parts[i]] || {};
|
|
1578
|
+
obj = obj[parts[i]];
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
/**
|
|
1585
|
+
* Gets a raw value from a path (no getters)
|
|
1586
|
+
*
|
|
1587
|
+
* @param {String} path
|
|
1588
|
+
* @api private
|
|
1589
|
+
*/
|
|
1590
|
+
|
|
1591
|
+
Document.prototype.$__getValue = function(path) {
|
|
1592
|
+
return utils.getValue(path, this._doc);
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
/**
|
|
1596
|
+
* Sets a raw value for a path (no casting, setters, transformations)
|
|
1597
|
+
*
|
|
1598
|
+
* @param {String} path
|
|
1599
|
+
* @param {Object} value
|
|
1600
|
+
* @api private
|
|
1601
|
+
*/
|
|
1602
|
+
|
|
1603
|
+
Document.prototype.$__setValue = function(path, val) {
|
|
1604
|
+
utils.setValue(path, val, this._doc);
|
|
1605
|
+
return this;
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* Returns the value of a path.
|
|
1610
|
+
*
|
|
1611
|
+
* ####Example
|
|
1612
|
+
*
|
|
1613
|
+
* // path
|
|
1614
|
+
* doc.get('age') // 47
|
|
1615
|
+
*
|
|
1616
|
+
* // dynamic casting to a string
|
|
1617
|
+
* doc.get('age', String) // "47"
|
|
1618
|
+
*
|
|
1619
|
+
* @param {String} path
|
|
1620
|
+
* @param {Schema|String|Number|Buffer|*} [type] optionally specify a type for on-the-fly attributes
|
|
1621
|
+
* @param {Object} [options]
|
|
1622
|
+
* @param {Boolean} [options.virtuals=false] Apply virtuals before getting this path
|
|
1623
|
+
* @param {Boolean} [options.getters=true] If false, skip applying getters and just get the raw value
|
|
1624
|
+
* @api public
|
|
1625
|
+
*/
|
|
1626
|
+
|
|
1627
|
+
Document.prototype.get = function(path, type, options) {
|
|
1628
|
+
let adhoc;
|
|
1629
|
+
options = options || {};
|
|
1630
|
+
if (type) {
|
|
1631
|
+
adhoc = this.$__schema.interpretAsType(path, type, this.$__schema.options);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
let schema = this.$__path(path);
|
|
1635
|
+
if (schema == null) {
|
|
1636
|
+
schema = this.$__schema.virtualpath(path);
|
|
1637
|
+
}
|
|
1638
|
+
if (schema instanceof mixed) {
|
|
1639
|
+
const virtual = this.$__schema.virtualpath(path);
|
|
1640
|
+
if (virtual != null) {
|
|
1641
|
+
schema = virtual;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
const pieces = path.indexOf('.') === -1 ? [path] : path.split('.');
|
|
1645
|
+
let obj = this._doc;
|
|
1646
|
+
|
|
1647
|
+
if (schema instanceof virtualtype) {
|
|
1648
|
+
return schema.applyGetters(void 0, this);
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
// Might need to change path for top-level alias
|
|
1652
|
+
if (typeof this.$__schema.aliases[pieces[0]] == 'string') {
|
|
1653
|
+
pieces[0] = this.$__schema.aliases[pieces[0]];
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
for (let i = 0, l = pieces.length; i < l; i++) {
|
|
1657
|
+
if (obj && obj._doc) {
|
|
1658
|
+
obj = obj._doc;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
if (obj == null) {
|
|
1662
|
+
obj = void 0;
|
|
1663
|
+
} else if (obj instanceof Map) {
|
|
1664
|
+
obj = obj.get(pieces[i], { getters: false });
|
|
1665
|
+
} else if (i === l - 1) {
|
|
1666
|
+
obj = utils.getValue(pieces[i], obj);
|
|
1667
|
+
} else {
|
|
1668
|
+
obj = obj[pieces[i]];
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
if (adhoc) {
|
|
1673
|
+
obj = adhoc.cast(obj);
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
if (schema != null && options.getters !== false) {
|
|
1677
|
+
obj = schema.applyGetters(obj, this);
|
|
1678
|
+
} else if (this.$__schema.nested[path] && options.virtuals) {
|
|
1679
|
+
// Might need to apply virtuals if this is a nested path
|
|
1680
|
+
return applyVirtuals(this, utils.clone(obj) || {}, { path: path });
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
return obj;
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
/*!
|
|
1687
|
+
* ignore
|
|
1688
|
+
*/
|
|
1689
|
+
|
|
1690
|
+
Document.prototype[getSymbol] = Document.prototype.get;
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* Returns the schematype for the given `path`.
|
|
1694
|
+
*
|
|
1695
|
+
* @param {String} path
|
|
1696
|
+
* @api private
|
|
1697
|
+
* @method $__path
|
|
1698
|
+
* @memberOf Document
|
|
1699
|
+
* @instance
|
|
1700
|
+
*/
|
|
1701
|
+
|
|
1702
|
+
Document.prototype.$__path = function(path) {
|
|
1703
|
+
const adhocs = this.$__.adhocPaths;
|
|
1704
|
+
const adhocType = adhocs && adhocs.hasOwnProperty(path) ? adhocs[path] : null;
|
|
1705
|
+
|
|
1706
|
+
if (adhocType) {
|
|
1707
|
+
return adhocType;
|
|
1708
|
+
}
|
|
1709
|
+
return this.$__schema.path(path);
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* Marks the path as having pending changes to write to the db.
|
|
1714
|
+
*
|
|
1715
|
+
* _Very helpful when using [Mixed](./schematypes.html#mixed) types._
|
|
1716
|
+
*
|
|
1717
|
+
* ####Example:
|
|
1718
|
+
*
|
|
1719
|
+
* doc.mixed.type = 'changed';
|
|
1720
|
+
* doc.markModified('mixed.type');
|
|
1721
|
+
* doc.save() // changes to mixed.type are now persisted
|
|
1722
|
+
*
|
|
1723
|
+
* @param {String} path the path to mark modified
|
|
1724
|
+
* @param {Document} [scope] the scope to run validators with
|
|
1725
|
+
* @api public
|
|
1726
|
+
*/
|
|
1727
|
+
|
|
1728
|
+
Document.prototype.markModified = function(path, scope) {
|
|
1729
|
+
this.$__.activePaths.modify(path);
|
|
1730
|
+
if (scope != null && !this.ownerDocument) {
|
|
1731
|
+
this.$__.pathsToScopes[path] = scope;
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
/**
|
|
1736
|
+
* Clears the modified state on the specified path.
|
|
1737
|
+
*
|
|
1738
|
+
* ####Example:
|
|
1739
|
+
*
|
|
1740
|
+
* doc.foo = 'bar';
|
|
1741
|
+
* doc.unmarkModified('foo');
|
|
1742
|
+
* doc.save(); // changes to foo will not be persisted
|
|
1743
|
+
*
|
|
1744
|
+
* @param {String} path the path to unmark modified
|
|
1745
|
+
* @api public
|
|
1746
|
+
*/
|
|
1747
|
+
|
|
1748
|
+
Document.prototype.unmarkModified = function(path) {
|
|
1749
|
+
this.$__.activePaths.init(path);
|
|
1750
|
+
delete this.$__.pathsToScopes[path];
|
|
1751
|
+
};
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* Don't run validation on this path or persist changes to this path.
|
|
1755
|
+
*
|
|
1756
|
+
* ####Example:
|
|
1757
|
+
*
|
|
1758
|
+
* doc.foo = null;
|
|
1759
|
+
* doc.$ignore('foo');
|
|
1760
|
+
* doc.save(); // changes to foo will not be persisted and validators won't be run
|
|
1761
|
+
*
|
|
1762
|
+
* @memberOf Document
|
|
1763
|
+
* @instance
|
|
1764
|
+
* @method $ignore
|
|
1765
|
+
* @param {String} path the path to ignore
|
|
1766
|
+
* @api public
|
|
1767
|
+
*/
|
|
1768
|
+
|
|
1769
|
+
Document.prototype.$ignore = function(path) {
|
|
1770
|
+
this.$__.activePaths.ignore(path);
|
|
1771
|
+
};
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* Returns the list of paths that have been directly modified. A direct
|
|
1775
|
+
* modified path is a path that you explicitly set, whether via `doc.foo = 'bar'`,
|
|
1776
|
+
* `Object.assign(doc, { foo: 'bar' })`, or `doc.set('foo', 'bar')`.
|
|
1777
|
+
*
|
|
1778
|
+
* A path `a` may be in `modifiedPaths()` but not in `directModifiedPaths()`
|
|
1779
|
+
* because a child of `a` was directly modified.
|
|
1780
|
+
*
|
|
1781
|
+
* ####Example
|
|
1782
|
+
* const schema = new Schema({ foo: String, nested: { bar: String } });
|
|
1783
|
+
* const Model = mongoose.model('Test', schema);
|
|
1784
|
+
* await Model.create({ foo: 'original', nested: { bar: 'original' } });
|
|
1785
|
+
*
|
|
1786
|
+
* const doc = await Model.findOne();
|
|
1787
|
+
* doc.nested.bar = 'modified';
|
|
1788
|
+
* doc.directModifiedPaths(); // ['nested.bar']
|
|
1789
|
+
* doc.modifiedPaths(); // ['nested', 'nested.bar']
|
|
1790
|
+
*
|
|
1791
|
+
* @return {Array}
|
|
1792
|
+
* @api public
|
|
1793
|
+
*/
|
|
1794
|
+
|
|
1795
|
+
Document.prototype.directModifiedPaths = function() {
|
|
1796
|
+
return Object.keys(this.$__.activePaths.states.modify);
|
|
1797
|
+
};
|
|
1798
|
+
|
|
1799
|
+
/**
|
|
1800
|
+
* Returns true if the given path is nullish or only contains empty objects.
|
|
1801
|
+
* Useful for determining whether this subdoc will get stripped out by the
|
|
1802
|
+
* [minimize option](/docs/guide.html#minimize).
|
|
1803
|
+
*
|
|
1804
|
+
* ####Example:
|
|
1805
|
+
* const schema = new Schema({ nested: { foo: String } });
|
|
1806
|
+
* const Model = mongoose.model('Test', schema);
|
|
1807
|
+
* const doc = new Model({});
|
|
1808
|
+
* doc.$isEmpty('nested'); // true
|
|
1809
|
+
* doc.nested.$isEmpty(); // true
|
|
1810
|
+
*
|
|
1811
|
+
* doc.nested.foo = 'bar';
|
|
1812
|
+
* doc.$isEmpty('nested'); // false
|
|
1813
|
+
* doc.nested.$isEmpty(); // false
|
|
1814
|
+
*
|
|
1815
|
+
* @memberOf Document
|
|
1816
|
+
* @instance
|
|
1817
|
+
* @api public
|
|
1818
|
+
* @method $isEmpty
|
|
1819
|
+
* @return {Boolean}
|
|
1820
|
+
*/
|
|
1821
|
+
|
|
1822
|
+
Document.prototype.$isEmpty = function(path) {
|
|
1823
|
+
const isEmptyOptions = {
|
|
1824
|
+
minimize: true,
|
|
1825
|
+
virtuals: false,
|
|
1826
|
+
getters: false,
|
|
1827
|
+
transform: false
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
if (arguments.length > 0) {
|
|
1831
|
+
const v = this.get(path);
|
|
1832
|
+
if (v == null) {
|
|
1833
|
+
return true;
|
|
1834
|
+
}
|
|
1835
|
+
if (typeof v !== 'object') {
|
|
1836
|
+
return false;
|
|
1837
|
+
}
|
|
1838
|
+
if (utils.isPOJO(v)) {
|
|
1839
|
+
return _isEmpty(v);
|
|
1840
|
+
}
|
|
1841
|
+
return Object.keys(v.toObject(isEmptyOptions)).length === 0;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
return Object.keys(this.toObject(isEmptyOptions)).length === 0;
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1847
|
+
function _isEmpty(v) {
|
|
1848
|
+
if (v == null) {
|
|
1849
|
+
return true;
|
|
1850
|
+
}
|
|
1851
|
+
if (typeof v !== 'object' || Array.isArray(v)) {
|
|
1852
|
+
return false;
|
|
1853
|
+
}
|
|
1854
|
+
for (const key of Object.keys(v)) {
|
|
1855
|
+
if (!_isEmpty(v[key])) {
|
|
1856
|
+
return false;
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
return true;
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
/**
|
|
1863
|
+
* Returns the list of paths that have been modified.
|
|
1864
|
+
*
|
|
1865
|
+
* @param {Object} [options]
|
|
1866
|
+
* @param {Boolean} [options.includeChildren=false] if true, returns children of modified paths as well. For example, if false, the list of modified paths for `doc.colors = { primary: 'blue' };` will **not** contain `colors.primary`. If true, `modifiedPaths()` will return an array that contains `colors.primary`.
|
|
1867
|
+
* @return {Array}
|
|
1868
|
+
* @api public
|
|
1869
|
+
*/
|
|
1870
|
+
|
|
1871
|
+
Document.prototype.modifiedPaths = function(options) {
|
|
1872
|
+
options = options || {};
|
|
1873
|
+
const directModifiedPaths = Object.keys(this.$__.activePaths.states.modify);
|
|
1874
|
+
const _this = this;
|
|
1875
|
+
return directModifiedPaths.reduce(function(list, path) {
|
|
1876
|
+
const parts = path.split('.');
|
|
1877
|
+
list = list.concat(parts.reduce(function(chains, part, i) {
|
|
1878
|
+
return chains.concat(parts.slice(0, i).concat(part).join('.'));
|
|
1879
|
+
}, []).filter(function(chain) {
|
|
1880
|
+
return (list.indexOf(chain) === -1);
|
|
1881
|
+
}));
|
|
1882
|
+
|
|
1883
|
+
if (!options.includeChildren) {
|
|
1884
|
+
return list;
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
let cur = _this.get(path);
|
|
1888
|
+
if (cur != null && typeof cur === 'object') {
|
|
1889
|
+
if (cur._doc) {
|
|
1890
|
+
cur = cur._doc;
|
|
1891
|
+
}
|
|
1892
|
+
if (Array.isArray(cur)) {
|
|
1893
|
+
const len = cur.length;
|
|
1894
|
+
for (let i = 0; i < len; ++i) {
|
|
1895
|
+
if (list.indexOf(path + '.' + i) === -1) {
|
|
1896
|
+
list.push(path + '.' + i);
|
|
1897
|
+
if (cur[i] != null && cur[i].$__) {
|
|
1898
|
+
const modified = cur[i].modifiedPaths();
|
|
1899
|
+
for (const childPath of modified) {
|
|
1900
|
+
list.push(path + '.' + i + '.' + childPath);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
} else {
|
|
1906
|
+
Object.keys(cur).
|
|
1907
|
+
filter(function(key) {
|
|
1908
|
+
return list.indexOf(path + '.' + key) === -1;
|
|
1909
|
+
}).
|
|
1910
|
+
forEach(function(key) {
|
|
1911
|
+
list.push(path + '.' + key);
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
return list;
|
|
1917
|
+
}, []);
|
|
1918
|
+
};
|
|
1919
|
+
|
|
1920
|
+
Document.prototype[documentModifiedPaths] = Document.prototype.modifiedPaths;
|
|
1921
|
+
|
|
1922
|
+
/**
|
|
1923
|
+
* Returns true if any of the given paths is modified, else false. If no arguments, returns `true` if any path
|
|
1924
|
+
* in this document is modified.
|
|
1925
|
+
*
|
|
1926
|
+
* If `path` is given, checks if a path or any full path containing `path` as part of its path chain has been modified.
|
|
1927
|
+
*
|
|
1928
|
+
* ####Example
|
|
1929
|
+
*
|
|
1930
|
+
* doc.set('documents.0.title', 'changed');
|
|
1931
|
+
* doc.isModified() // true
|
|
1932
|
+
* doc.isModified('documents') // true
|
|
1933
|
+
* doc.isModified('documents.0.title') // true
|
|
1934
|
+
* doc.isModified('documents otherProp') // true
|
|
1935
|
+
* doc.isDirectModified('documents') // false
|
|
1936
|
+
*
|
|
1937
|
+
* @param {String} [path] optional
|
|
1938
|
+
* @return {Boolean}
|
|
1939
|
+
* @api public
|
|
1940
|
+
*/
|
|
1941
|
+
|
|
1942
|
+
Document.prototype.isModified = function(paths, modifiedPaths) {
|
|
1943
|
+
if (paths) {
|
|
1944
|
+
if (!Array.isArray(paths)) {
|
|
1945
|
+
paths = paths.split(' ');
|
|
1946
|
+
}
|
|
1947
|
+
const modified = modifiedPaths || this[documentModifiedPaths]();
|
|
1948
|
+
const directModifiedPaths = Object.keys(this.$__.activePaths.states.modify);
|
|
1949
|
+
const isModifiedChild = paths.some(function(path) {
|
|
1950
|
+
return !!~modified.indexOf(path);
|
|
1951
|
+
});
|
|
1952
|
+
|
|
1953
|
+
return isModifiedChild || paths.some(function(path) {
|
|
1954
|
+
return directModifiedPaths.some(function(mod) {
|
|
1955
|
+
return mod === path || path.startsWith(mod + '.');
|
|
1956
|
+
});
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
return this.$__.activePaths.some('modify');
|
|
1961
|
+
};
|
|
1962
|
+
|
|
1963
|
+
Document.prototype[documentIsModified] = Document.prototype.isModified;
|
|
1964
|
+
|
|
1965
|
+
/**
|
|
1966
|
+
* Checks if a path is set to its default.
|
|
1967
|
+
*
|
|
1968
|
+
* ####Example
|
|
1969
|
+
*
|
|
1970
|
+
* MyModel = mongoose.model('test', { name: { type: String, default: 'Val '} });
|
|
1971
|
+
* const m = new MyModel();
|
|
1972
|
+
* m.$isDefault('name'); // true
|
|
1973
|
+
*
|
|
1974
|
+
* @memberOf Document
|
|
1975
|
+
* @instance
|
|
1976
|
+
* @method $isDefault
|
|
1977
|
+
* @param {String} [path]
|
|
1978
|
+
* @return {Boolean}
|
|
1979
|
+
* @api public
|
|
1980
|
+
*/
|
|
1981
|
+
|
|
1982
|
+
Document.prototype.$isDefault = function(path) {
|
|
1983
|
+
if (path == null) {
|
|
1984
|
+
return this.$__.activePaths.some('default');
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
if (typeof path === 'string' && path.indexOf(' ') === -1) {
|
|
1988
|
+
return this.$__.activePaths.states.default.hasOwnProperty(path);
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
let paths = path;
|
|
1992
|
+
if (!Array.isArray(paths)) {
|
|
1993
|
+
paths = paths.split(' ');
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
return paths.some(path => this.$__.activePaths.states.default.hasOwnProperty(path));
|
|
1997
|
+
};
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* Getter/setter, determines whether the document was removed or not.
|
|
2001
|
+
*
|
|
2002
|
+
* ####Example:
|
|
2003
|
+
* product.remove(function (err, product) {
|
|
2004
|
+
* product.$isDeleted(); // true
|
|
2005
|
+
* product.remove(); // no-op, doesn't send anything to the db
|
|
2006
|
+
*
|
|
2007
|
+
* product.$isDeleted(false);
|
|
2008
|
+
* product.$isDeleted(); // false
|
|
2009
|
+
* product.remove(); // will execute a remove against the db
|
|
2010
|
+
* })
|
|
2011
|
+
*
|
|
2012
|
+
* @param {Boolean} [val] optional, overrides whether mongoose thinks the doc is deleted
|
|
2013
|
+
* @return {Boolean} whether mongoose thinks this doc is deleted.
|
|
2014
|
+
* @method $isDeleted
|
|
2015
|
+
* @memberOf Document
|
|
2016
|
+
* @instance
|
|
2017
|
+
* @api public
|
|
2018
|
+
*/
|
|
2019
|
+
|
|
2020
|
+
Document.prototype.$isDeleted = function(val) {
|
|
2021
|
+
if (arguments.length === 0) {
|
|
2022
|
+
return !!this.$__.isDeleted;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
this.$__.isDeleted = !!val;
|
|
2026
|
+
return this;
|
|
2027
|
+
};
|
|
2028
|
+
|
|
2029
|
+
/**
|
|
2030
|
+
* Returns true if `path` was directly set and modified, else false.
|
|
2031
|
+
*
|
|
2032
|
+
* ####Example
|
|
2033
|
+
*
|
|
2034
|
+
* doc.set('documents.0.title', 'changed');
|
|
2035
|
+
* doc.isDirectModified('documents.0.title') // true
|
|
2036
|
+
* doc.isDirectModified('documents') // false
|
|
2037
|
+
*
|
|
2038
|
+
* @param {String|Array<String>} path
|
|
2039
|
+
* @return {Boolean}
|
|
2040
|
+
* @api public
|
|
2041
|
+
*/
|
|
2042
|
+
|
|
2043
|
+
Document.prototype.isDirectModified = function(path) {
|
|
2044
|
+
if (path == null) {
|
|
2045
|
+
return this.$__.activePaths.some('modify');
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
if (typeof path === 'string' && path.indexOf(' ') === -1) {
|
|
2049
|
+
return this.$__.activePaths.states.modify.hasOwnProperty(path);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
let paths = path;
|
|
2053
|
+
if (!Array.isArray(paths)) {
|
|
2054
|
+
paths = paths.split(' ');
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
return paths.some(path => this.$__.activePaths.states.modify.hasOwnProperty(path));
|
|
2058
|
+
};
|
|
2059
|
+
|
|
2060
|
+
/**
|
|
2061
|
+
* Checks if `path` is in the `init` state, that is, it was set by `Document#init()` and not modified since.
|
|
2062
|
+
*
|
|
2063
|
+
* @param {String} path
|
|
2064
|
+
* @return {Boolean}
|
|
2065
|
+
* @api public
|
|
2066
|
+
*/
|
|
2067
|
+
|
|
2068
|
+
Document.prototype.isInit = function(path) {
|
|
2069
|
+
if (path == null) {
|
|
2070
|
+
return this.$__.activePaths.some('init');
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
if (typeof path === 'string' && path.indexOf(' ') === -1) {
|
|
2074
|
+
return this.$__.activePaths.states.init.hasOwnProperty(path);
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
let paths = path;
|
|
2078
|
+
if (!Array.isArray(paths)) {
|
|
2079
|
+
paths = paths.split(' ');
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
return paths.some(path => this.$__.activePaths.states.init.hasOwnProperty(path));
|
|
2083
|
+
};
|
|
2084
|
+
|
|
2085
|
+
/**
|
|
2086
|
+
* Checks if `path` was selected in the source query which initialized this document.
|
|
2087
|
+
*
|
|
2088
|
+
* ####Example
|
|
2089
|
+
*
|
|
2090
|
+
* Thing.findOne().select('name').exec(function (err, doc) {
|
|
2091
|
+
* doc.isSelected('name') // true
|
|
2092
|
+
* doc.isSelected('age') // false
|
|
2093
|
+
* })
|
|
2094
|
+
*
|
|
2095
|
+
* @param {String|Array<String>} path
|
|
2096
|
+
* @return {Boolean}
|
|
2097
|
+
* @api public
|
|
2098
|
+
*/
|
|
2099
|
+
|
|
2100
|
+
Document.prototype.isSelected = function isSelected(path) {
|
|
2101
|
+
if (this.$__.selected == null) {
|
|
2102
|
+
return true;
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
if (path === '_id') {
|
|
2106
|
+
return this.$__.selected._id !== 0;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
if (path.indexOf(' ') !== -1) {
|
|
2110
|
+
path = path.split(' ');
|
|
2111
|
+
}
|
|
2112
|
+
if (Array.isArray(path)) {
|
|
2113
|
+
return path.some(p => this.$__isSelected(p));
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
const paths = Object.keys(this.$__.selected);
|
|
2117
|
+
let inclusive = null;
|
|
2118
|
+
|
|
2119
|
+
if (paths.length === 1 && paths[0] === '_id') {
|
|
2120
|
+
// only _id was selected.
|
|
2121
|
+
return this.$__.selected._id === 0;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
for (const cur of paths) {
|
|
2125
|
+
if (cur === '_id') {
|
|
2126
|
+
continue;
|
|
2127
|
+
}
|
|
2128
|
+
if (!isDefiningProjection(this.$__.selected[cur])) {
|
|
2129
|
+
continue;
|
|
2130
|
+
}
|
|
2131
|
+
inclusive = !!this.$__.selected[cur];
|
|
2132
|
+
break;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
if (inclusive === null) {
|
|
2136
|
+
return true;
|
|
2137
|
+
}
|
|
2138
|
+
|
|
2139
|
+
if (path in this.$__.selected) {
|
|
2140
|
+
return inclusive;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
const pathDot = path + '.';
|
|
2144
|
+
|
|
2145
|
+
for (const cur of paths) {
|
|
2146
|
+
if (cur === '_id') {
|
|
2147
|
+
continue;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
if (cur.startsWith(pathDot)) {
|
|
2151
|
+
return inclusive || cur !== pathDot;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
if (pathDot.startsWith(cur + '.')) {
|
|
2155
|
+
return inclusive;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
return !inclusive;
|
|
2160
|
+
};
|
|
2161
|
+
|
|
2162
|
+
Document.prototype.$__isSelected = Document.prototype.isSelected;
|
|
2163
|
+
|
|
2164
|
+
/**
|
|
2165
|
+
* Checks if `path` was explicitly selected. If no projection, always returns
|
|
2166
|
+
* true.
|
|
2167
|
+
*
|
|
2168
|
+
* ####Example
|
|
2169
|
+
*
|
|
2170
|
+
* Thing.findOne().select('nested.name').exec(function (err, doc) {
|
|
2171
|
+
* doc.isDirectSelected('nested.name') // true
|
|
2172
|
+
* doc.isDirectSelected('nested.otherName') // false
|
|
2173
|
+
* doc.isDirectSelected('nested') // false
|
|
2174
|
+
* })
|
|
2175
|
+
*
|
|
2176
|
+
* @param {String} path
|
|
2177
|
+
* @return {Boolean}
|
|
2178
|
+
* @api public
|
|
2179
|
+
*/
|
|
2180
|
+
|
|
2181
|
+
Document.prototype.isDirectSelected = function isDirectSelected(path) {
|
|
2182
|
+
if (this.$__.selected == null) {
|
|
2183
|
+
return true;
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
if (path === '_id') {
|
|
2187
|
+
return this.$__.selected._id !== 0;
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2190
|
+
if (path.indexOf(' ') !== -1) {
|
|
2191
|
+
path = path.split(' ');
|
|
2192
|
+
}
|
|
2193
|
+
if (Array.isArray(path)) {
|
|
2194
|
+
return path.some(p => this.isDirectSelected(p));
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
const paths = Object.keys(this.$__.selected);
|
|
2198
|
+
let inclusive = null;
|
|
2199
|
+
|
|
2200
|
+
if (paths.length === 1 && paths[0] === '_id') {
|
|
2201
|
+
// only _id was selected.
|
|
2202
|
+
return this.$__.selected._id === 0;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
for (const cur of paths) {
|
|
2206
|
+
if (cur === '_id') {
|
|
2207
|
+
continue;
|
|
2208
|
+
}
|
|
2209
|
+
if (!isDefiningProjection(this.$__.selected[cur])) {
|
|
2210
|
+
continue;
|
|
2211
|
+
}
|
|
2212
|
+
inclusive = !!this.$__.selected[cur];
|
|
2213
|
+
break;
|
|
2214
|
+
}
|
|
2215
|
+
|
|
2216
|
+
if (inclusive === null) {
|
|
2217
|
+
return true;
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
if (this.$__.selected.hasOwnProperty(path)) {
|
|
2221
|
+
return inclusive;
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
return !inclusive;
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2227
|
+
/**
|
|
2228
|
+
* Executes registered validation rules for this document.
|
|
2229
|
+
*
|
|
2230
|
+
* ####Note:
|
|
2231
|
+
*
|
|
2232
|
+
* This method is called `pre` save and if a validation rule is violated, [save](#model_Model-save) is aborted and the error is returned to your `callback`.
|
|
2233
|
+
*
|
|
2234
|
+
* ####Example:
|
|
2235
|
+
*
|
|
2236
|
+
* doc.validate(function (err) {
|
|
2237
|
+
* if (err) handleError(err);
|
|
2238
|
+
* else // validation passed
|
|
2239
|
+
* });
|
|
2240
|
+
*
|
|
2241
|
+
* @param {Array|String} [pathsToValidate] list of paths to validate. If set, Mongoose will validate only the modified paths that are in the given list.
|
|
2242
|
+
* @param {Object} [options] internal options
|
|
2243
|
+
* @param {Boolean} [options.validateModifiedOnly=false] if `true` mongoose validates only modified paths.
|
|
2244
|
+
* @param {Array|string} [options.pathsToSkip] list of paths to skip. If set, Mongoose will validate every modified path that is not in this list.
|
|
2245
|
+
* @param {Function} [callback] optional callback called after validation completes, passing an error if one occurred
|
|
2246
|
+
* @return {Promise} Promise
|
|
2247
|
+
* @api public
|
|
2248
|
+
*/
|
|
2249
|
+
|
|
2250
|
+
Document.prototype.validate = function(pathsToValidate, options, callback) {
|
|
2251
|
+
let parallelValidate$1;
|
|
2252
|
+
this.$op = 'validate';
|
|
2253
|
+
|
|
2254
|
+
if (this.ownerDocument != null) ; else if (this.$__.validating) {
|
|
2255
|
+
parallelValidate$1 = new parallelValidate(this, {
|
|
2256
|
+
parentStack: options && options.parentStack,
|
|
2257
|
+
conflictStack: this.$__.validating.stack
|
|
2258
|
+
});
|
|
2259
|
+
} else {
|
|
2260
|
+
this.$__.validating = new parallelValidate(this, { parentStack: options && options.parentStack });
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
if (arguments.length === 1) {
|
|
2264
|
+
if (typeof arguments[0] === 'object' && !Array.isArray(arguments[0])) {
|
|
2265
|
+
options = arguments[0];
|
|
2266
|
+
callback = null;
|
|
2267
|
+
pathsToValidate = null;
|
|
2268
|
+
} else if (typeof arguments[0] === 'function') {
|
|
2269
|
+
callback = arguments[0];
|
|
2270
|
+
options = null;
|
|
2271
|
+
pathsToValidate = null;
|
|
2272
|
+
}
|
|
2273
|
+
} else if (typeof pathsToValidate === 'function') {
|
|
2274
|
+
callback = pathsToValidate;
|
|
2275
|
+
options = null;
|
|
2276
|
+
pathsToValidate = null;
|
|
2277
|
+
} else if (typeof options === 'function') {
|
|
2278
|
+
callback = options;
|
|
2279
|
+
options = pathsToValidate;
|
|
2280
|
+
pathsToValidate = null;
|
|
2281
|
+
}
|
|
2282
|
+
if (options && typeof options.pathsToSkip === 'string') {
|
|
2283
|
+
const isOnePathOnly = options.pathsToSkip.indexOf(' ') === -1;
|
|
2284
|
+
options.pathsToSkip = isOnePathOnly ? [options.pathsToSkip] : options.pathsToSkip.split(' ');
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
return promiseOrCallback(callback, cb => {
|
|
2288
|
+
if (parallelValidate$1 != null) {
|
|
2289
|
+
return cb(parallelValidate$1);
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
this.$__validate(pathsToValidate, options, (error) => {
|
|
2293
|
+
this.$op = null;
|
|
2294
|
+
cb(error);
|
|
2295
|
+
});
|
|
2296
|
+
}, this.constructor.events);
|
|
2297
|
+
};
|
|
2298
|
+
|
|
2299
|
+
/*!
|
|
2300
|
+
* ignore
|
|
2301
|
+
*/
|
|
2302
|
+
|
|
2303
|
+
function _evaluateRequiredFunctions(doc) {
|
|
2304
|
+
Object.keys(doc.$__.activePaths.states.require).forEach(path => {
|
|
2305
|
+
const p = doc.$__schema.path(path);
|
|
2306
|
+
|
|
2307
|
+
if (p != null && typeof p.originalRequiredValue === 'function') {
|
|
2308
|
+
doc.$__.cachedRequired[path] = p.originalRequiredValue.call(doc, doc);
|
|
2309
|
+
}
|
|
2310
|
+
});
|
|
2311
|
+
}
|
|
2312
|
+
|
|
2313
|
+
/*!
|
|
2314
|
+
* ignore
|
|
2315
|
+
*/
|
|
2316
|
+
|
|
2317
|
+
function _getPathsToValidate(doc) {
|
|
2318
|
+
const skipSchemaValidators = {};
|
|
2319
|
+
|
|
2320
|
+
_evaluateRequiredFunctions(doc);
|
|
2321
|
+
// only validate required fields when necessary
|
|
2322
|
+
let paths = new Set(Object.keys(doc.$__.activePaths.states.require).filter(function(path) {
|
|
2323
|
+
if (!doc.$__isSelected(path) && !doc.isModified(path)) {
|
|
2324
|
+
return false;
|
|
2325
|
+
}
|
|
2326
|
+
if (path in doc.$__.cachedRequired) {
|
|
2327
|
+
return doc.$__.cachedRequired[path];
|
|
2328
|
+
}
|
|
2329
|
+
return true;
|
|
2330
|
+
}));
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
Object.keys(doc.$__.activePaths.states.init).forEach(addToPaths);
|
|
2334
|
+
Object.keys(doc.$__.activePaths.states.modify).forEach(addToPaths);
|
|
2335
|
+
Object.keys(doc.$__.activePaths.states.default).forEach(addToPaths);
|
|
2336
|
+
function addToPaths(p) { paths.add(p); }
|
|
2337
|
+
|
|
2338
|
+
const subdocs = doc.$getAllSubdocs();
|
|
2339
|
+
const modifiedPaths = doc.modifiedPaths();
|
|
2340
|
+
for (const subdoc of subdocs) {
|
|
2341
|
+
if (subdoc.$basePath) {
|
|
2342
|
+
// Remove child paths for now, because we'll be validating the whole
|
|
2343
|
+
// subdoc
|
|
2344
|
+
for (const p of paths) {
|
|
2345
|
+
if (p === null || p.startsWith(subdoc.$basePath + '.')) {
|
|
2346
|
+
paths.delete(p);
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
if (doc.isModified(subdoc.$basePath, modifiedPaths) &&
|
|
2351
|
+
!doc.isDirectModified(subdoc.$basePath) &&
|
|
2352
|
+
!doc.$isDefault(subdoc.$basePath)) {
|
|
2353
|
+
paths.add(subdoc.$basePath);
|
|
2354
|
+
|
|
2355
|
+
skipSchemaValidators[subdoc.$basePath] = true;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
// from here on we're not removing items from paths
|
|
2361
|
+
|
|
2362
|
+
// gh-661: if a whole array is modified, make sure to run validation on all
|
|
2363
|
+
// the children as well
|
|
2364
|
+
for (const path of paths) {
|
|
2365
|
+
const _pathType = doc.$__schema.path(path);
|
|
2366
|
+
if (!_pathType ||
|
|
2367
|
+
!_pathType.$isMongooseArray ||
|
|
2368
|
+
// To avoid potential performance issues, skip doc arrays whose children
|
|
2369
|
+
// are not required. `getPositionalPathType()` may be slow, so avoid
|
|
2370
|
+
// it unless we have a case of #6364
|
|
2371
|
+
(_pathType.$isMongooseDocumentArray && !get(_pathType, 'schemaOptions.required'))) {
|
|
2372
|
+
continue;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
const val = doc.$__getValue(path);
|
|
2376
|
+
_pushNestedArrayPaths(val, paths, path);
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
function _pushNestedArrayPaths(val, paths, path) {
|
|
2380
|
+
if (val != null) {
|
|
2381
|
+
const numElements = val.length;
|
|
2382
|
+
for (let j = 0; j < numElements; ++j) {
|
|
2383
|
+
if (Array.isArray(val[j])) {
|
|
2384
|
+
_pushNestedArrayPaths(val[j], paths, path + '.' + j);
|
|
2385
|
+
} else {
|
|
2386
|
+
paths.add(path + '.' + j);
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
const flattenOptions = { skipArrays: true };
|
|
2393
|
+
for (const pathToCheck of paths) {
|
|
2394
|
+
if (doc.$__schema.nested[pathToCheck]) {
|
|
2395
|
+
let _v = doc.$__getValue(pathToCheck);
|
|
2396
|
+
if (isMongooseObject(_v)) {
|
|
2397
|
+
_v = _v.toObject({ transform: false });
|
|
2398
|
+
}
|
|
2399
|
+
const flat = flatten(_v, pathToCheck, flattenOptions, doc.$__schema);
|
|
2400
|
+
Object.keys(flat).forEach(addToPaths);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
for (const path of paths) {
|
|
2405
|
+
// Single nested paths (paths embedded under single nested subdocs) will
|
|
2406
|
+
// be validated on their own when we call `validate()` on the subdoc itself.
|
|
2407
|
+
// Re: gh-8468
|
|
2408
|
+
if (doc.$__schema.singleNestedPaths.hasOwnProperty(path)) {
|
|
2409
|
+
paths.delete(path);
|
|
2410
|
+
continue;
|
|
2411
|
+
}
|
|
2412
|
+
const _pathType = doc.$__schema.path(path);
|
|
2413
|
+
if (!_pathType || !_pathType.$isSchemaMap) {
|
|
2414
|
+
continue;
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
const val = doc.$__getValue(path);
|
|
2418
|
+
if (val == null) {
|
|
2419
|
+
continue;
|
|
2420
|
+
}
|
|
2421
|
+
for (const key of val.keys()) {
|
|
2422
|
+
paths.add(path + '.' + key);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
paths = Array.from(paths);
|
|
2427
|
+
return [paths, skipSchemaValidators];
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
/*!
|
|
2431
|
+
* ignore
|
|
2432
|
+
*/
|
|
2433
|
+
|
|
2434
|
+
Document.prototype.$__validate = function(pathsToValidate, options, callback) {
|
|
2435
|
+
if (typeof pathsToValidate === 'function') {
|
|
2436
|
+
callback = pathsToValidate;
|
|
2437
|
+
options = null;
|
|
2438
|
+
pathsToValidate = null;
|
|
2439
|
+
} else if (typeof options === 'function') {
|
|
2440
|
+
callback = options;
|
|
2441
|
+
options = null;
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
const hasValidateModifiedOnlyOption = options &&
|
|
2445
|
+
(typeof options === 'object') &&
|
|
2446
|
+
('validateModifiedOnly' in options);
|
|
2447
|
+
|
|
2448
|
+
const pathsToSkip = get(options, 'pathsToSkip', null);
|
|
2449
|
+
|
|
2450
|
+
let shouldValidateModifiedOnly;
|
|
2451
|
+
if (hasValidateModifiedOnlyOption) {
|
|
2452
|
+
shouldValidateModifiedOnly = !!options.validateModifiedOnly;
|
|
2453
|
+
} else {
|
|
2454
|
+
shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly;
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
const _this = this;
|
|
2458
|
+
const _complete = () => {
|
|
2459
|
+
let validationError = this.$__.validationError;
|
|
2460
|
+
this.$__.validationError = undefined;
|
|
2461
|
+
|
|
2462
|
+
if (shouldValidateModifiedOnly && validationError != null) {
|
|
2463
|
+
// Remove any validation errors that aren't from modified paths
|
|
2464
|
+
const errors = Object.keys(validationError.errors);
|
|
2465
|
+
for (const errPath of errors) {
|
|
2466
|
+
if (!this.isModified(errPath)) {
|
|
2467
|
+
delete validationError.errors[errPath];
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
if (Object.keys(validationError.errors).length === 0) {
|
|
2471
|
+
validationError = void 0;
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
this.$__.cachedRequired = {};
|
|
2476
|
+
this.emit('validate', _this);
|
|
2477
|
+
this.constructor.emit('validate', _this);
|
|
2478
|
+
|
|
2479
|
+
this.$__.validating = null;
|
|
2480
|
+
if (validationError) {
|
|
2481
|
+
for (const key in validationError.errors) {
|
|
2482
|
+
// Make sure cast errors persist
|
|
2483
|
+
if (!this[documentArrayParent] &&
|
|
2484
|
+
validationError.errors[key] instanceof error.CastError) {
|
|
2485
|
+
this.invalidate(key, validationError.errors[key]);
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
return validationError;
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
|
|
2493
|
+
// only validate required fields when necessary
|
|
2494
|
+
const pathDetails = _getPathsToValidate(this);
|
|
2495
|
+
let paths = shouldValidateModifiedOnly ?
|
|
2496
|
+
pathDetails[0].filter((path) => this.isModified(path)) :
|
|
2497
|
+
pathDetails[0];
|
|
2498
|
+
const skipSchemaValidators = pathDetails[1];
|
|
2499
|
+
if (typeof pathsToValidate === 'string') {
|
|
2500
|
+
pathsToValidate = pathsToValidate.split(' ');
|
|
2501
|
+
}
|
|
2502
|
+
if (Array.isArray(pathsToValidate)) {
|
|
2503
|
+
paths = _handlePathsToValidate(paths, pathsToValidate);
|
|
2504
|
+
} else if (pathsToSkip) {
|
|
2505
|
+
paths = _handlePathsToSkip(paths, pathsToSkip);
|
|
2506
|
+
}
|
|
2507
|
+
if (paths.length === 0) {
|
|
2508
|
+
return immediate(function() {
|
|
2509
|
+
const error = _complete();
|
|
2510
|
+
if (error) {
|
|
2511
|
+
return _this.$__schema.s.hooks.execPost('validate:error', _this, [_this], { error: error }, function(error) {
|
|
2512
|
+
callback(error);
|
|
2513
|
+
});
|
|
2514
|
+
}
|
|
2515
|
+
callback(null, _this);
|
|
2516
|
+
});
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
const validated = {};
|
|
2520
|
+
let total = 0;
|
|
2521
|
+
|
|
2522
|
+
for (const path of paths) {
|
|
2523
|
+
validatePath(path);
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
function validatePath(path) {
|
|
2527
|
+
if (path == null || validated[path]) {
|
|
2528
|
+
return;
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
validated[path] = true;
|
|
2532
|
+
total++;
|
|
2533
|
+
|
|
2534
|
+
immediate(function() {
|
|
2535
|
+
const schemaType = _this.$__schema.path(path);
|
|
2536
|
+
|
|
2537
|
+
if (!schemaType) {
|
|
2538
|
+
return --total || complete();
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
// If user marked as invalid or there was a cast error, don't validate
|
|
2542
|
+
if (!_this.$isValid(path)) {
|
|
2543
|
+
--total || complete();
|
|
2544
|
+
return;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
// If setting a path under a mixed path, avoid using the mixed path validator (gh-10141)
|
|
2548
|
+
if (schemaType[schemaMixedSymbol] != null && path !== schemaType.path) {
|
|
2549
|
+
return --total || complete();
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
let val = _this.$__getValue(path);
|
|
2553
|
+
|
|
2554
|
+
// If you `populate()` and get back a null value, required validators
|
|
2555
|
+
// shouldn't fail (gh-8018). We should always fall back to the populated
|
|
2556
|
+
// value.
|
|
2557
|
+
let pop;
|
|
2558
|
+
if (val == null && (pop = _this.populated(path))) {
|
|
2559
|
+
val = pop;
|
|
2560
|
+
}
|
|
2561
|
+
const scope = path in _this.$__.pathsToScopes ?
|
|
2562
|
+
_this.$__.pathsToScopes[path] :
|
|
2563
|
+
_this;
|
|
2564
|
+
|
|
2565
|
+
const doValidateOptions = {
|
|
2566
|
+
skipSchemaValidators: skipSchemaValidators[path],
|
|
2567
|
+
path: path,
|
|
2568
|
+
validateModifiedOnly: shouldValidateModifiedOnly
|
|
2569
|
+
};
|
|
2570
|
+
schemaType.doValidate(val, function(err) {
|
|
2571
|
+
if (err && (!schemaType.$isMongooseDocumentArray || err.$isArrayValidatorError)) {
|
|
2572
|
+
if (schemaType.$isSingleNested &&
|
|
2573
|
+
err instanceof validation &&
|
|
2574
|
+
schemaType.schema.options.storeSubdocValidationError === false) {
|
|
2575
|
+
return --total || complete();
|
|
2576
|
+
}
|
|
2577
|
+
_this.invalidate(path, err, undefined, true);
|
|
2578
|
+
}
|
|
2579
|
+
--total || complete();
|
|
2580
|
+
}, scope, doValidateOptions);
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
|
|
2584
|
+
function complete() {
|
|
2585
|
+
const error = _complete();
|
|
2586
|
+
if (error) {
|
|
2587
|
+
return _this.$__schema.s.hooks.execPost('validate:error', _this, [_this], { error: error }, function(error) {
|
|
2588
|
+
callback(error);
|
|
2589
|
+
});
|
|
2590
|
+
}
|
|
2591
|
+
callback(null, _this);
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
};
|
|
2595
|
+
|
|
2596
|
+
/*!
|
|
2597
|
+
* ignore
|
|
2598
|
+
*/
|
|
2599
|
+
|
|
2600
|
+
function _handlePathsToValidate(paths, pathsToValidate) {
|
|
2601
|
+
const _pathsToValidate = new Set(pathsToValidate);
|
|
2602
|
+
const parentPaths = new Map([]);
|
|
2603
|
+
for (const path of pathsToValidate) {
|
|
2604
|
+
if (path.indexOf('.') === -1) {
|
|
2605
|
+
continue;
|
|
2606
|
+
}
|
|
2607
|
+
const pieces = path.split('.');
|
|
2608
|
+
let cur = pieces[0];
|
|
2609
|
+
for (let i = 1; i < pieces.length; ++i) {
|
|
2610
|
+
// Since we skip subpaths under single nested subdocs to
|
|
2611
|
+
// avoid double validation, we need to add back the
|
|
2612
|
+
// single nested subpath if the user asked for it (gh-8626)
|
|
2613
|
+
parentPaths.set(cur, path);
|
|
2614
|
+
cur = cur + '.' + pieces[i];
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
const ret = [];
|
|
2619
|
+
for (const path of paths) {
|
|
2620
|
+
if (_pathsToValidate.has(path)) {
|
|
2621
|
+
ret.push(path);
|
|
2622
|
+
} else if (parentPaths.has(path)) {
|
|
2623
|
+
ret.push(parentPaths.get(path));
|
|
2624
|
+
}
|
|
2625
|
+
}
|
|
2626
|
+
return ret;
|
|
2627
|
+
}
|
|
2628
|
+
|
|
2629
|
+
/*!
|
|
2630
|
+
* ignore
|
|
2631
|
+
*/
|
|
2632
|
+
function _handlePathsToSkip(paths, pathsToSkip) {
|
|
2633
|
+
pathsToSkip = new Set(pathsToSkip);
|
|
2634
|
+
paths = paths.filter(p => !pathsToSkip.has(p));
|
|
2635
|
+
return paths;
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
/**
|
|
2639
|
+
* Executes registered validation rules (skipping asynchronous validators) for this document.
|
|
2640
|
+
*
|
|
2641
|
+
* ####Note:
|
|
2642
|
+
*
|
|
2643
|
+
* This method is useful if you need synchronous validation.
|
|
2644
|
+
*
|
|
2645
|
+
* ####Example:
|
|
2646
|
+
*
|
|
2647
|
+
* const err = doc.validateSync();
|
|
2648
|
+
* if (err) {
|
|
2649
|
+
* handleError(err);
|
|
2650
|
+
* } else {
|
|
2651
|
+
* // validation passed
|
|
2652
|
+
* }
|
|
2653
|
+
*
|
|
2654
|
+
* @param {Array|string} pathsToValidate only validate the given paths
|
|
2655
|
+
* @param {Object} [options] options for validation
|
|
2656
|
+
* @param {Boolean} [options.validateModifiedOnly=false] If `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths.
|
|
2657
|
+
* @param {Array|string} [options.pathsToSkip] list of paths to skip. If set, Mongoose will validate every modified path that is not in this list.
|
|
2658
|
+
* @return {ValidationError|undefined} ValidationError if there are errors during validation, or undefined if there is no error.
|
|
2659
|
+
* @api public
|
|
2660
|
+
*/
|
|
2661
|
+
|
|
2662
|
+
Document.prototype.validateSync = function(pathsToValidate, options) {
|
|
2663
|
+
const _this = this;
|
|
2664
|
+
|
|
2665
|
+
if (arguments.length === 1 && typeof arguments[0] === 'object' && !Array.isArray(arguments[0])) {
|
|
2666
|
+
options = arguments[0];
|
|
2667
|
+
pathsToValidate = null;
|
|
2668
|
+
}
|
|
2669
|
+
|
|
2670
|
+
const hasValidateModifiedOnlyOption = options &&
|
|
2671
|
+
(typeof options === 'object') &&
|
|
2672
|
+
('validateModifiedOnly' in options);
|
|
2673
|
+
|
|
2674
|
+
let shouldValidateModifiedOnly;
|
|
2675
|
+
if (hasValidateModifiedOnlyOption) {
|
|
2676
|
+
shouldValidateModifiedOnly = !!options.validateModifiedOnly;
|
|
2677
|
+
} else {
|
|
2678
|
+
shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly;
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
let pathsToSkip = options && options.pathsToSkip;
|
|
2682
|
+
|
|
2683
|
+
if (typeof pathsToValidate === 'string') {
|
|
2684
|
+
const isOnePathOnly = pathsToValidate.indexOf(' ') === -1;
|
|
2685
|
+
pathsToValidate = isOnePathOnly ? [pathsToValidate] : pathsToValidate.split(' ');
|
|
2686
|
+
} else if (typeof pathsToSkip === 'string' && pathsToSkip.indexOf(' ') !== -1) {
|
|
2687
|
+
pathsToSkip = pathsToSkip.split(' ');
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
// only validate required fields when necessary
|
|
2691
|
+
const pathDetails = _getPathsToValidate(this);
|
|
2692
|
+
let paths = shouldValidateModifiedOnly ?
|
|
2693
|
+
pathDetails[0].filter((path) => this.isModified(path)) :
|
|
2694
|
+
pathDetails[0];
|
|
2695
|
+
const skipSchemaValidators = pathDetails[1];
|
|
2696
|
+
|
|
2697
|
+
if (Array.isArray(pathsToValidate)) {
|
|
2698
|
+
paths = _handlePathsToValidate(paths, pathsToValidate);
|
|
2699
|
+
} else if (Array.isArray(pathsToSkip)) {
|
|
2700
|
+
paths = _handlePathsToSkip(paths, pathsToSkip);
|
|
2701
|
+
}
|
|
2702
|
+
const validating = {};
|
|
2703
|
+
|
|
2704
|
+
paths.forEach(function(path) {
|
|
2705
|
+
if (validating[path]) {
|
|
2706
|
+
return;
|
|
2707
|
+
}
|
|
2708
|
+
|
|
2709
|
+
validating[path] = true;
|
|
2710
|
+
|
|
2711
|
+
const p = _this.$__schema.path(path);
|
|
2712
|
+
if (!p) {
|
|
2713
|
+
return;
|
|
2714
|
+
}
|
|
2715
|
+
if (!_this.$isValid(path)) {
|
|
2716
|
+
return;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
const val = _this.$__getValue(path);
|
|
2720
|
+
const err = p.doValidateSync(val, _this, {
|
|
2721
|
+
skipSchemaValidators: skipSchemaValidators[path],
|
|
2722
|
+
path: path,
|
|
2723
|
+
validateModifiedOnly: shouldValidateModifiedOnly
|
|
2724
|
+
});
|
|
2725
|
+
if (err && (!p.$isMongooseDocumentArray || err.$isArrayValidatorError)) {
|
|
2726
|
+
if (p.$isSingleNested &&
|
|
2727
|
+
err instanceof validation &&
|
|
2728
|
+
p.schema.options.storeSubdocValidationError === false) {
|
|
2729
|
+
return;
|
|
2730
|
+
}
|
|
2731
|
+
_this.invalidate(path, err, undefined, true);
|
|
2732
|
+
}
|
|
2733
|
+
});
|
|
2734
|
+
|
|
2735
|
+
const err = _this.$__.validationError;
|
|
2736
|
+
_this.$__.validationError = undefined;
|
|
2737
|
+
_this.emit('validate', _this);
|
|
2738
|
+
_this.constructor.emit('validate', _this);
|
|
2739
|
+
|
|
2740
|
+
if (err) {
|
|
2741
|
+
for (const key in err.errors) {
|
|
2742
|
+
// Make sure cast errors persist
|
|
2743
|
+
if (err.errors[key] instanceof error.CastError) {
|
|
2744
|
+
_this.invalidate(key, err.errors[key]);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
return err;
|
|
2750
|
+
};
|
|
2751
|
+
|
|
2752
|
+
/**
|
|
2753
|
+
* Marks a path as invalid, causing validation to fail.
|
|
2754
|
+
*
|
|
2755
|
+
* The `errorMsg` argument will become the message of the `ValidationError`.
|
|
2756
|
+
*
|
|
2757
|
+
* The `value` argument (if passed) will be available through the `ValidationError.value` property.
|
|
2758
|
+
*
|
|
2759
|
+
* doc.invalidate('size', 'must be less than 20', 14);
|
|
2760
|
+
|
|
2761
|
+
* doc.validate(function (err) {
|
|
2762
|
+
* console.log(err)
|
|
2763
|
+
* // prints
|
|
2764
|
+
* { message: 'Validation failed',
|
|
2765
|
+
* name: 'ValidationError',
|
|
2766
|
+
* errors:
|
|
2767
|
+
* { size:
|
|
2768
|
+
* { message: 'must be less than 20',
|
|
2769
|
+
* name: 'ValidatorError',
|
|
2770
|
+
* path: 'size',
|
|
2771
|
+
* type: 'user defined',
|
|
2772
|
+
* value: 14 } } }
|
|
2773
|
+
* })
|
|
2774
|
+
*
|
|
2775
|
+
* @param {String} path the field to invalidate. For array elements, use the `array.i.field` syntax, where `i` is the 0-based index in the array.
|
|
2776
|
+
* @param {String|Error} errorMsg the error which states the reason `path` was invalid
|
|
2777
|
+
* @param {Object|String|Number|any} value optional invalid value
|
|
2778
|
+
* @param {String} [kind] optional `kind` property for the error
|
|
2779
|
+
* @return {ValidationError} the current ValidationError, with all currently invalidated paths
|
|
2780
|
+
* @api public
|
|
2781
|
+
*/
|
|
2782
|
+
|
|
2783
|
+
Document.prototype.invalidate = function(path, err, val, kind) {
|
|
2784
|
+
if (!this.$__.validationError) {
|
|
2785
|
+
this.$__.validationError = new validation(this);
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
if (this.$__.validationError.errors[path]) {
|
|
2789
|
+
return;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
if (!err || typeof err === 'string') {
|
|
2793
|
+
err = new validator({
|
|
2794
|
+
path: path,
|
|
2795
|
+
message: err,
|
|
2796
|
+
type: kind || 'user defined',
|
|
2797
|
+
value: val
|
|
2798
|
+
});
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
if (this.$__.validationError === err) {
|
|
2802
|
+
return this.$__.validationError;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
this.$__.validationError.addError(path, err);
|
|
2806
|
+
return this.$__.validationError;
|
|
2807
|
+
};
|
|
2808
|
+
|
|
2809
|
+
/**
|
|
2810
|
+
* Marks a path as valid, removing existing validation errors.
|
|
2811
|
+
*
|
|
2812
|
+
* @param {String} path the field to mark as valid
|
|
2813
|
+
* @api public
|
|
2814
|
+
* @memberOf Document
|
|
2815
|
+
* @instance
|
|
2816
|
+
* @method $markValid
|
|
2817
|
+
*/
|
|
2818
|
+
|
|
2819
|
+
Document.prototype.$markValid = function(path) {
|
|
2820
|
+
if (!this.$__.validationError || !this.$__.validationError.errors[path]) {
|
|
2821
|
+
return;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
delete this.$__.validationError.errors[path];
|
|
2825
|
+
if (Object.keys(this.$__.validationError.errors).length === 0) {
|
|
2826
|
+
this.$__.validationError = null;
|
|
2827
|
+
}
|
|
2828
|
+
};
|
|
2829
|
+
|
|
2830
|
+
/*!
|
|
2831
|
+
* ignore
|
|
2832
|
+
*/
|
|
2833
|
+
|
|
2834
|
+
function _markValidSubpaths(doc, path) {
|
|
2835
|
+
if (!doc.$__.validationError) {
|
|
2836
|
+
return;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
const keys = Object.keys(doc.$__.validationError.errors);
|
|
2840
|
+
for (const key of keys) {
|
|
2841
|
+
if (key.startsWith(path + '.')) {
|
|
2842
|
+
delete doc.$__.validationError.errors[key];
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
if (Object.keys(doc.$__.validationError.errors).length === 0) {
|
|
2846
|
+
doc.$__.validationError = null;
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
/*!
|
|
2851
|
+
* ignore
|
|
2852
|
+
*/
|
|
2853
|
+
|
|
2854
|
+
function _checkImmutableSubpaths(subdoc, schematype, priorVal) {
|
|
2855
|
+
const schema = schematype.schema;
|
|
2856
|
+
if (schema == null) {
|
|
2857
|
+
return;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
for (const key of Object.keys(schema.paths)) {
|
|
2861
|
+
const path = schema.paths[key];
|
|
2862
|
+
if (path.$immutableSetter == null) {
|
|
2863
|
+
continue;
|
|
2864
|
+
}
|
|
2865
|
+
const oldVal = priorVal == null ? void 0 : priorVal.$__getValue(key);
|
|
2866
|
+
// Calling immutableSetter with `oldVal` even though it expects `newVal`
|
|
2867
|
+
// is intentional. That's because `$immutableSetter` compares its param
|
|
2868
|
+
// to the current value.
|
|
2869
|
+
path.$immutableSetter.call(subdoc, oldVal);
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
/**
|
|
2874
|
+
* Saves this document by inserting a new document into the database if [document.isNew](/docs/api.html#document_Document-isNew) is `true`,
|
|
2875
|
+
* or sends an [updateOne](/docs/api.html#document_Document-updateOne) operation **only** with the modifications to the database, it does not replace the whole document in the latter case.
|
|
2876
|
+
*
|
|
2877
|
+
* ####Example:
|
|
2878
|
+
*
|
|
2879
|
+
* product.sold = Date.now();
|
|
2880
|
+
* product = await product.save();
|
|
2881
|
+
*
|
|
2882
|
+
* If save is successful, the returned promise will fulfill with the document
|
|
2883
|
+
* saved.
|
|
2884
|
+
*
|
|
2885
|
+
* ####Example:
|
|
2886
|
+
*
|
|
2887
|
+
* const newProduct = await product.save();
|
|
2888
|
+
* newProduct === product; // true
|
|
2889
|
+
*
|
|
2890
|
+
* @param {Object} [options] options optional options
|
|
2891
|
+
* @param {Session} [options.session=null] the [session](https://docs.mongodb.com/manual/reference/server-sessions/) associated with this save operation. If not specified, defaults to the [document's associated session](api.html#document_Document-$session).
|
|
2892
|
+
* @param {Object} [options.safe] (DEPRECATED) overrides [schema's safe option](http://mongoosejs.com//docs/guide.html#safe). Use the `w` option instead.
|
|
2893
|
+
* @param {Boolean} [options.validateBeforeSave] set to false to save without validating.
|
|
2894
|
+
* @param {Boolean} [options.validateModifiedOnly=false] If `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths.
|
|
2895
|
+
* @param {Number|String} [options.w] set the [write concern](https://docs.mongodb.com/manual/reference/write-concern/#w-option). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern)
|
|
2896
|
+
* @param {Boolean} [options.j] set to true for MongoDB to wait until this `save()` has been [journaled before resolving the returned promise](https://docs.mongodb.com/manual/reference/write-concern/#j-option). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern)
|
|
2897
|
+
* @param {Number} [options.wtimeout] sets a [timeout for the write concern](https://docs.mongodb.com/manual/reference/write-concern/#wtimeout). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern).
|
|
2898
|
+
* @param {Boolean} [options.checkKeys=true] the MongoDB driver prevents you from saving keys that start with '$' or contain '.' by default. Set this option to `false` to skip that check. See [restrictions on field names](https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names)
|
|
2899
|
+
* @param {Boolean} [options.timestamps=true] if `false` and [timestamps](./guide.html#timestamps) are enabled, skip timestamps for this `save()`.
|
|
2900
|
+
* @param {Function} [fn] optional callback
|
|
2901
|
+
* @method save
|
|
2902
|
+
* @memberOf Document
|
|
2903
|
+
* @instance
|
|
2904
|
+
* @throws {DocumentNotFoundError} if this [save updates an existing document](api.html#document_Document-isNew) but the document doesn't exist in the database. For example, you will get this error if the document is [deleted between when you retrieved the document and when you saved it](documents.html#updating).
|
|
2905
|
+
* @return {Promise|undefined} Returns undefined if used with callback or a Promise otherwise.
|
|
2906
|
+
* @api public
|
|
2907
|
+
* @see middleware http://mongoosejs.com/docs/middleware.html
|
|
2908
|
+
*/
|
|
2909
|
+
|
|
2910
|
+
/**
|
|
2911
|
+
* Checks if a path is invalid
|
|
2912
|
+
*
|
|
2913
|
+
* @param {String|Array<String>} path the field to check
|
|
2914
|
+
* @method $isValid
|
|
2915
|
+
* @memberOf Document
|
|
2916
|
+
* @instance
|
|
2917
|
+
* @api private
|
|
2918
|
+
*/
|
|
2919
|
+
|
|
2920
|
+
Document.prototype.$isValid = function(path) {
|
|
2921
|
+
if (this.$__.validationError == null || Object.keys(this.$__.validationError.errors).length === 0) {
|
|
2922
|
+
return true;
|
|
2923
|
+
}
|
|
2924
|
+
if (path == null) {
|
|
2925
|
+
return false;
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
if (path.indexOf(' ') !== -1) {
|
|
2929
|
+
path = path.split(' ');
|
|
2930
|
+
}
|
|
2931
|
+
if (Array.isArray(path)) {
|
|
2932
|
+
return path.some(p => this.$__.validationError.errors[p] == null);
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
return this.$__.validationError.errors[path] == null;
|
|
2936
|
+
};
|
|
2937
|
+
|
|
2938
|
+
/**
|
|
2939
|
+
* Resets the internal modified state of this document.
|
|
2940
|
+
*
|
|
2941
|
+
* @api private
|
|
2942
|
+
* @return {Document}
|
|
2943
|
+
* @method $__reset
|
|
2944
|
+
* @memberOf Document
|
|
2945
|
+
* @instance
|
|
2946
|
+
*/
|
|
2947
|
+
|
|
2948
|
+
Document.prototype.$__reset = function reset() {
|
|
2949
|
+
let _this = this;
|
|
2950
|
+
|
|
2951
|
+
this.$__.activePaths
|
|
2952
|
+
.map('init', 'modify', function(i) {
|
|
2953
|
+
return _this.$__getValue(i);
|
|
2954
|
+
})
|
|
2955
|
+
.filter(function(val) {
|
|
2956
|
+
return val && val instanceof Array && val.isMongooseDocumentArray && val.length;
|
|
2957
|
+
})
|
|
2958
|
+
.forEach(function(array) {
|
|
2959
|
+
let i = array.length;
|
|
2960
|
+
while (i--) {
|
|
2961
|
+
const doc = array[i];
|
|
2962
|
+
if (!doc) {
|
|
2963
|
+
continue;
|
|
2964
|
+
}
|
|
2965
|
+
doc.$__reset();
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
_this.$__.activePaths.init(array.$path());
|
|
2969
|
+
|
|
2970
|
+
array[arrayAtomicsBackupSymbol] = array[arrayAtomicsSymbol];
|
|
2971
|
+
array[arrayAtomicsSymbol] = {};
|
|
2972
|
+
});
|
|
2973
|
+
|
|
2974
|
+
this.$__.activePaths.
|
|
2975
|
+
map('init', 'modify', function(i) {
|
|
2976
|
+
return _this.$__getValue(i);
|
|
2977
|
+
}).
|
|
2978
|
+
filter(function(val) {
|
|
2979
|
+
return val && val.$isSingleNested;
|
|
2980
|
+
}).
|
|
2981
|
+
forEach(function(doc) {
|
|
2982
|
+
doc.$__reset();
|
|
2983
|
+
if (doc.$__parent === _this) {
|
|
2984
|
+
_this.$__.activePaths.init(doc.$basePath);
|
|
2985
|
+
} else if (doc.$__parent != null && doc.$__parent.ownerDocument) {
|
|
2986
|
+
// If map path underneath subdocument, may end up with a case where
|
|
2987
|
+
// map path is modified but parent still needs to be reset. See gh-10295
|
|
2988
|
+
doc.$__parent.$__reset();
|
|
2989
|
+
}
|
|
2990
|
+
});
|
|
2991
|
+
|
|
2992
|
+
// clear atomics
|
|
2993
|
+
this.$__dirty().forEach(function(dirt) {
|
|
2994
|
+
const type = dirt.value;
|
|
2995
|
+
|
|
2996
|
+
if (type && type[arrayAtomicsSymbol]) {
|
|
2997
|
+
type[arrayAtomicsBackupSymbol] = type[arrayAtomicsSymbol];
|
|
2998
|
+
type[arrayAtomicsSymbol] = {};
|
|
2999
|
+
}
|
|
3000
|
+
});
|
|
3001
|
+
|
|
3002
|
+
this.$__.backup = {};
|
|
3003
|
+
this.$__.backup.activePaths = {
|
|
3004
|
+
modify: Object.assign({}, this.$__.activePaths.states.modify),
|
|
3005
|
+
default: Object.assign({}, this.$__.activePaths.states.default)
|
|
3006
|
+
};
|
|
3007
|
+
this.$__.backup.validationError = this.$__.validationError;
|
|
3008
|
+
this.$__.backup.errors = this.errors;
|
|
3009
|
+
|
|
3010
|
+
// Clear 'dirty' cache
|
|
3011
|
+
this.$__.activePaths.clear('modify');
|
|
3012
|
+
this.$__.activePaths.clear('default');
|
|
3013
|
+
this.$__.validationError = undefined;
|
|
3014
|
+
this.errors = undefined;
|
|
3015
|
+
_this = this;
|
|
3016
|
+
this.$__schema.requiredPaths().forEach(function(path) {
|
|
3017
|
+
_this.$__.activePaths.require(path);
|
|
3018
|
+
});
|
|
3019
|
+
|
|
3020
|
+
return this;
|
|
3021
|
+
};
|
|
3022
|
+
|
|
3023
|
+
/*!
|
|
3024
|
+
* ignore
|
|
3025
|
+
*/
|
|
3026
|
+
|
|
3027
|
+
Document.prototype.$__undoReset = function $__undoReset() {
|
|
3028
|
+
if (this.$__.backup == null || this.$__.backup.activePaths == null) {
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
this.$__.activePaths.states.modify = this.$__.backup.activePaths.modify;
|
|
3033
|
+
this.$__.activePaths.states.default = this.$__.backup.activePaths.default;
|
|
3034
|
+
|
|
3035
|
+
this.$__.validationError = this.$__.backup.validationError;
|
|
3036
|
+
this.errors = this.$__.backup.errors;
|
|
3037
|
+
|
|
3038
|
+
for (const dirt of this.$__dirty()) {
|
|
3039
|
+
const type = dirt.value;
|
|
3040
|
+
|
|
3041
|
+
if (type && type[arrayAtomicsSymbol] && type[arrayAtomicsBackupSymbol]) {
|
|
3042
|
+
type[arrayAtomicsSymbol] = type[arrayAtomicsBackupSymbol];
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
for (const subdoc of this.$getAllSubdocs()) {
|
|
3047
|
+
subdoc.$__undoReset();
|
|
3048
|
+
}
|
|
3049
|
+
};
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* Returns this documents dirty paths / vals.
|
|
3053
|
+
*
|
|
3054
|
+
* @api private
|
|
3055
|
+
* @method $__dirty
|
|
3056
|
+
* @memberOf Document
|
|
3057
|
+
* @instance
|
|
3058
|
+
*/
|
|
3059
|
+
|
|
3060
|
+
Document.prototype.$__dirty = function() {
|
|
3061
|
+
const _this = this;
|
|
3062
|
+
|
|
3063
|
+
let all = this.$__.activePaths.map('modify', function(path) {
|
|
3064
|
+
return {
|
|
3065
|
+
path: path,
|
|
3066
|
+
value: _this.$__getValue(path),
|
|
3067
|
+
schema: _this.$__path(path)
|
|
3068
|
+
};
|
|
3069
|
+
});
|
|
3070
|
+
// gh-2558: if we had to set a default and the value is not undefined,
|
|
3071
|
+
// we have to save as well
|
|
3072
|
+
all = all.concat(this.$__.activePaths.map('default', function(path) {
|
|
3073
|
+
if (path === '_id' || _this.$__getValue(path) == null) {
|
|
3074
|
+
return;
|
|
3075
|
+
}
|
|
3076
|
+
return {
|
|
3077
|
+
path: path,
|
|
3078
|
+
value: _this.$__getValue(path),
|
|
3079
|
+
schema: _this.$__path(path)
|
|
3080
|
+
};
|
|
3081
|
+
}));
|
|
3082
|
+
|
|
3083
|
+
// Sort dirty paths in a flat hierarchy.
|
|
3084
|
+
all.sort(function(a, b) {
|
|
3085
|
+
return (a.path < b.path ? -1 : (a.path > b.path ? 1 : 0));
|
|
3086
|
+
});
|
|
3087
|
+
|
|
3088
|
+
// Ignore "foo.a" if "foo" is dirty already.
|
|
3089
|
+
const minimal = [];
|
|
3090
|
+
let lastPath;
|
|
3091
|
+
let top;
|
|
3092
|
+
|
|
3093
|
+
all.forEach(function(item) {
|
|
3094
|
+
if (!item) {
|
|
3095
|
+
return;
|
|
3096
|
+
}
|
|
3097
|
+
if (lastPath == null || item.path.indexOf(lastPath) !== 0) {
|
|
3098
|
+
lastPath = item.path + '.';
|
|
3099
|
+
minimal.push(item);
|
|
3100
|
+
top = item;
|
|
3101
|
+
} else if (top != null &&
|
|
3102
|
+
top.value != null &&
|
|
3103
|
+
top.value[arrayAtomicsSymbol] != null &&
|
|
3104
|
+
top.value.hasAtomics()) {
|
|
3105
|
+
// special case for top level MongooseArrays
|
|
3106
|
+
// the `top` array itself and a sub path of `top` are being modified.
|
|
3107
|
+
// the only way to honor all of both modifications is through a $set
|
|
3108
|
+
// of entire array.
|
|
3109
|
+
top.value[arrayAtomicsSymbol] = {};
|
|
3110
|
+
top.value[arrayAtomicsSymbol].$set = top.value;
|
|
3111
|
+
}
|
|
3112
|
+
});
|
|
3113
|
+
top = lastPath = null;
|
|
3114
|
+
return minimal;
|
|
3115
|
+
};
|
|
3116
|
+
|
|
3117
|
+
/**
|
|
3118
|
+
* Assigns/compiles `schema` into this documents prototype.
|
|
3119
|
+
*
|
|
3120
|
+
* @param {Schema} schema
|
|
3121
|
+
* @api private
|
|
3122
|
+
* @method $__setSchema
|
|
3123
|
+
* @memberOf Document
|
|
3124
|
+
* @instance
|
|
3125
|
+
*/
|
|
3126
|
+
|
|
3127
|
+
Document.prototype.$__setSchema = function(schema) {
|
|
3128
|
+
schema.plugin(idGetter_1, { deduplicate: true });
|
|
3129
|
+
compile(schema.tree, this, undefined, schema.options);
|
|
3130
|
+
|
|
3131
|
+
// Apply default getters if virtual doesn't have any (gh-6262)
|
|
3132
|
+
for (const key of Object.keys(schema.virtuals)) {
|
|
3133
|
+
schema.virtuals[key]._applyDefaultGetters();
|
|
3134
|
+
}
|
|
3135
|
+
if (schema.path('schema') == null) {
|
|
3136
|
+
this.schema = schema;
|
|
3137
|
+
}
|
|
3138
|
+
this.$__schema = schema;
|
|
3139
|
+
this[documentSchemaSymbol] = schema;
|
|
3140
|
+
};
|
|
3141
|
+
|
|
3142
|
+
|
|
3143
|
+
/**
|
|
3144
|
+
* Get active path that were changed and are arrays
|
|
3145
|
+
*
|
|
3146
|
+
* @api private
|
|
3147
|
+
* @method $__getArrayPathsToValidate
|
|
3148
|
+
* @memberOf Document
|
|
3149
|
+
* @instance
|
|
3150
|
+
*/
|
|
3151
|
+
|
|
3152
|
+
Document.prototype.$__getArrayPathsToValidate = function() {
|
|
3153
|
+
|
|
3154
|
+
// validate all document arrays.
|
|
3155
|
+
return this.$__.activePaths
|
|
3156
|
+
.map('init', 'modify', function(i) {
|
|
3157
|
+
return this.$__getValue(i);
|
|
3158
|
+
}.bind(this))
|
|
3159
|
+
.filter(function(val) {
|
|
3160
|
+
return val && val instanceof Array && val.isMongooseDocumentArray && val.length;
|
|
3161
|
+
}).reduce(function(seed, array) {
|
|
3162
|
+
return seed.concat(array);
|
|
3163
|
+
}, [])
|
|
3164
|
+
.filter(function(doc) {
|
|
3165
|
+
return doc;
|
|
3166
|
+
});
|
|
3167
|
+
};
|
|
3168
|
+
|
|
3169
|
+
|
|
3170
|
+
/**
|
|
3171
|
+
* Get all subdocs (by bfs)
|
|
3172
|
+
*
|
|
3173
|
+
* @api public
|
|
3174
|
+
* @method $getAllSubdocs
|
|
3175
|
+
* @memberOf Document
|
|
3176
|
+
* @instance
|
|
3177
|
+
*/
|
|
3178
|
+
|
|
3179
|
+
Document.prototype.$getAllSubdocs = function $getAllSubdocs() {
|
|
3180
|
+
Embedded = Embedded || embedded;
|
|
3181
|
+
|
|
3182
|
+
function docReducer(doc, seed, path) {
|
|
3183
|
+
let val = doc;
|
|
3184
|
+
let isNested = false;
|
|
3185
|
+
if (path) {
|
|
3186
|
+
if (doc instanceof Document && doc[documentSchemaSymbol].paths[path]) {
|
|
3187
|
+
val = doc._doc[path];
|
|
3188
|
+
} else if (doc instanceof Document && doc[documentSchemaSymbol].nested[path]) {
|
|
3189
|
+
val = doc._doc[path];
|
|
3190
|
+
isNested = true;
|
|
3191
|
+
} else {
|
|
3192
|
+
val = doc[path];
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
if (val instanceof Embedded) {
|
|
3196
|
+
seed.push(val);
|
|
3197
|
+
} else if (val instanceof Map) {
|
|
3198
|
+
seed = Array.from(val.keys()).reduce(function(seed, path) {
|
|
3199
|
+
return docReducer(val.get(path), seed, null);
|
|
3200
|
+
}, seed);
|
|
3201
|
+
} else if (val && val.$isSingleNested) {
|
|
3202
|
+
seed = Object.keys(val._doc).reduce(function(seed, path) {
|
|
3203
|
+
return docReducer(val._doc, seed, path);
|
|
3204
|
+
}, seed);
|
|
3205
|
+
seed.push(val);
|
|
3206
|
+
} else if (val && val.isMongooseDocumentArray) {
|
|
3207
|
+
val.forEach(function _docReduce(doc) {
|
|
3208
|
+
if (!doc || !doc._doc) {
|
|
3209
|
+
return;
|
|
3210
|
+
}
|
|
3211
|
+
seed = Object.keys(doc._doc).reduce(function(seed, path) {
|
|
3212
|
+
return docReducer(doc._doc, seed, path);
|
|
3213
|
+
}, seed);
|
|
3214
|
+
if (doc instanceof Embedded) {
|
|
3215
|
+
seed.push(doc);
|
|
3216
|
+
}
|
|
3217
|
+
});
|
|
3218
|
+
} else if (isNested && val != null) {
|
|
3219
|
+
for (const path of Object.keys(val)) {
|
|
3220
|
+
docReducer(val, seed, path);
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
return seed;
|
|
3224
|
+
}
|
|
3225
|
+
|
|
3226
|
+
const subDocs = [];
|
|
3227
|
+
for (const path of Object.keys(this._doc)) {
|
|
3228
|
+
docReducer(this, subDocs, path);
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3231
|
+
return subDocs;
|
|
3232
|
+
};
|
|
3233
|
+
|
|
3234
|
+
/*!
|
|
3235
|
+
* Runs queued functions
|
|
3236
|
+
*/
|
|
3237
|
+
|
|
3238
|
+
function applyQueue(doc) {
|
|
3239
|
+
const q = doc.$__schema && doc.$__schema.callQueue;
|
|
3240
|
+
if (!q.length) {
|
|
3241
|
+
return;
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
for (const pair of q) {
|
|
3245
|
+
if (pair[0] !== 'pre' && pair[0] !== 'post' && pair[0] !== 'on') {
|
|
3246
|
+
doc[pair[0]].apply(doc, pair[1]);
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
/*!
|
|
3252
|
+
* ignore
|
|
3253
|
+
*/
|
|
3254
|
+
|
|
3255
|
+
Document.prototype.$__handleReject = function handleReject(err) {
|
|
3256
|
+
// emit on the Model if listening
|
|
3257
|
+
if (this.listeners('error').length) {
|
|
3258
|
+
this.emit('error', err);
|
|
3259
|
+
} else if (this.constructor.listeners && this.constructor.listeners('error').length) {
|
|
3260
|
+
this.constructor.emit('error', err);
|
|
3261
|
+
}
|
|
3262
|
+
};
|
|
3263
|
+
|
|
3264
|
+
/**
|
|
3265
|
+
* Internal helper for toObject() and toJSON() that doesn't manipulate options
|
|
3266
|
+
*
|
|
3267
|
+
* @api private
|
|
3268
|
+
* @method $toObject
|
|
3269
|
+
* @memberOf Document
|
|
3270
|
+
* @instance
|
|
3271
|
+
*/
|
|
3272
|
+
|
|
3273
|
+
Document.prototype.$toObject = function(options, json) {
|
|
3274
|
+
let defaultOptions = {
|
|
3275
|
+
transform: true,
|
|
3276
|
+
flattenDecimals: true
|
|
3277
|
+
};
|
|
3278
|
+
|
|
3279
|
+
const path = json ? 'toJSON' : 'toObject';
|
|
3280
|
+
const baseOptions = get(this, 'constructor.base.options.' + path, {});
|
|
3281
|
+
const schemaOptions = get(this, '$__schema.options', {});
|
|
3282
|
+
// merge base default options with Schema's set default options if available.
|
|
3283
|
+
// `clone` is necessary here because `utils.options` directly modifies the second input.
|
|
3284
|
+
defaultOptions = utils.options(defaultOptions, clone(baseOptions));
|
|
3285
|
+
defaultOptions = utils.options(defaultOptions, clone(schemaOptions[path] || {}));
|
|
3286
|
+
|
|
3287
|
+
// If options do not exist or is not an object, set it to empty object
|
|
3288
|
+
options = utils.isPOJO(options) ? clone(options) : {};
|
|
3289
|
+
options._calledWithOptions = options._calledWithOptions || clone(options);
|
|
3290
|
+
|
|
3291
|
+
let _minimize;
|
|
3292
|
+
if (options._calledWithOptions.minimize != null) {
|
|
3293
|
+
_minimize = options.minimize;
|
|
3294
|
+
} else if (defaultOptions.minimize != null) {
|
|
3295
|
+
_minimize = defaultOptions.minimize;
|
|
3296
|
+
} else {
|
|
3297
|
+
_minimize = schemaOptions.minimize;
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
let flattenMaps;
|
|
3301
|
+
if (options._calledWithOptions.flattenMaps != null) {
|
|
3302
|
+
flattenMaps = options.flattenMaps;
|
|
3303
|
+
} else if (defaultOptions.flattenMaps != null) {
|
|
3304
|
+
flattenMaps = defaultOptions.flattenMaps;
|
|
3305
|
+
} else {
|
|
3306
|
+
flattenMaps = schemaOptions.flattenMaps;
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
// The original options that will be passed to `clone()`. Important because
|
|
3310
|
+
// `clone()` will recursively call `$toObject()` on embedded docs, so we
|
|
3311
|
+
// need the original options the user passed in, plus `_isNested` and
|
|
3312
|
+
// `_parentOptions` for checking whether we need to depopulate.
|
|
3313
|
+
const cloneOptions = Object.assign(utils.clone(options), {
|
|
3314
|
+
_isNested: true,
|
|
3315
|
+
json: json,
|
|
3316
|
+
minimize: _minimize,
|
|
3317
|
+
flattenMaps: flattenMaps
|
|
3318
|
+
});
|
|
3319
|
+
|
|
3320
|
+
if (utils.hasUserDefinedProperty(options, 'getters')) {
|
|
3321
|
+
cloneOptions.getters = options.getters;
|
|
3322
|
+
}
|
|
3323
|
+
if (utils.hasUserDefinedProperty(options, 'virtuals')) {
|
|
3324
|
+
cloneOptions.virtuals = options.virtuals;
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3327
|
+
const depopulate = options.depopulate ||
|
|
3328
|
+
get(options, '_parentOptions.depopulate', false);
|
|
3329
|
+
// _isNested will only be true if this is not the top level document, we
|
|
3330
|
+
// should never depopulate
|
|
3331
|
+
if (depopulate && options._isNested && this.$__.wasPopulated) {
|
|
3332
|
+
// populated paths that we set to a document
|
|
3333
|
+
return clone(this._id, cloneOptions);
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
// merge default options with input options.
|
|
3337
|
+
options = utils.options(defaultOptions, options);
|
|
3338
|
+
options._isNested = true;
|
|
3339
|
+
options.json = json;
|
|
3340
|
+
options.minimize = _minimize;
|
|
3341
|
+
|
|
3342
|
+
cloneOptions._parentOptions = options;
|
|
3343
|
+
cloneOptions._skipSingleNestedGetters = true;
|
|
3344
|
+
|
|
3345
|
+
const gettersOptions = Object.assign({}, cloneOptions);
|
|
3346
|
+
gettersOptions._skipSingleNestedGetters = false;
|
|
3347
|
+
|
|
3348
|
+
// remember the root transform function
|
|
3349
|
+
// to save it from being overwritten by sub-transform functions
|
|
3350
|
+
const originalTransform = options.transform;
|
|
3351
|
+
|
|
3352
|
+
let ret = clone(this._doc, cloneOptions) || {};
|
|
3353
|
+
|
|
3354
|
+
if (options.getters) {
|
|
3355
|
+
applyGetters(this, ret, gettersOptions);
|
|
3356
|
+
|
|
3357
|
+
if (options.minimize) {
|
|
3358
|
+
ret = minimize(ret) || {};
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
if (options.virtuals || (options.getters && options.virtuals !== false)) {
|
|
3363
|
+
applyVirtuals(this, ret, gettersOptions, options);
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
if (options.versionKey === false && this.$__schema.options.versionKey) {
|
|
3367
|
+
delete ret[this.$__schema.options.versionKey];
|
|
3368
|
+
}
|
|
3369
|
+
|
|
3370
|
+
let transform = options.transform;
|
|
3371
|
+
|
|
3372
|
+
// In the case where a subdocument has its own transform function, we need to
|
|
3373
|
+
// check and see if the parent has a transform (options.transform) and if the
|
|
3374
|
+
// child schema has a transform (this.schema.options.toObject) In this case,
|
|
3375
|
+
// we need to adjust options.transform to be the child schema's transform and
|
|
3376
|
+
// not the parent schema's
|
|
3377
|
+
if (transform) {
|
|
3378
|
+
applySchemaTypeTransforms(this, ret);
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3381
|
+
if (options.useProjection) {
|
|
3382
|
+
omitDeselectedFields(this, ret);
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
if (transform === true || (schemaOptions.toObject && transform)) {
|
|
3386
|
+
const opts = options.json ? schemaOptions.toJSON : schemaOptions.toObject;
|
|
3387
|
+
|
|
3388
|
+
if (opts) {
|
|
3389
|
+
transform = (typeof options.transform === 'function' ? options.transform : opts.transform);
|
|
3390
|
+
}
|
|
3391
|
+
} else {
|
|
3392
|
+
options.transform = originalTransform;
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3395
|
+
if (typeof transform === 'function') {
|
|
3396
|
+
const xformed = transform(this, ret, options);
|
|
3397
|
+
if (typeof xformed !== 'undefined') {
|
|
3398
|
+
ret = xformed;
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
|
|
3402
|
+
return ret;
|
|
3403
|
+
};
|
|
3404
|
+
|
|
3405
|
+
/**
|
|
3406
|
+
* Converts this document into a plain-old JavaScript object ([POJO](https://masteringjs.io/tutorials/fundamentals/pojo)).
|
|
3407
|
+
*
|
|
3408
|
+
* Buffers are converted to instances of [mongodb.Binary](http://mongodb.github.com/node-mongodb-native/api-bson-generated/binary.html) for proper storage.
|
|
3409
|
+
*
|
|
3410
|
+
* ####Options:
|
|
3411
|
+
*
|
|
3412
|
+
* - `getters` apply all getters (path and virtual getters), defaults to false
|
|
3413
|
+
* - `aliases` apply all aliases if `virtuals=true`, defaults to true
|
|
3414
|
+
* - `virtuals` apply virtual getters (can override `getters` option), defaults to false
|
|
3415
|
+
* - `minimize` remove empty objects, defaults to true
|
|
3416
|
+
* - `transform` a transform function to apply to the resulting document before returning
|
|
3417
|
+
* - `depopulate` depopulate any populated paths, replacing them with their original refs, defaults to false
|
|
3418
|
+
* - `versionKey` whether to include the version key, defaults to true
|
|
3419
|
+
* - `flattenMaps` convert Maps to POJOs. Useful if you want to JSON.stringify() the result of toObject(), defaults to false
|
|
3420
|
+
* - `useProjection` set to `true` to omit fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema.
|
|
3421
|
+
*
|
|
3422
|
+
* ####Getters/Virtuals
|
|
3423
|
+
*
|
|
3424
|
+
* Example of only applying path getters
|
|
3425
|
+
*
|
|
3426
|
+
* doc.toObject({ getters: true, virtuals: false })
|
|
3427
|
+
*
|
|
3428
|
+
* Example of only applying virtual getters
|
|
3429
|
+
*
|
|
3430
|
+
* doc.toObject({ virtuals: true })
|
|
3431
|
+
*
|
|
3432
|
+
* Example of applying both path and virtual getters
|
|
3433
|
+
*
|
|
3434
|
+
* doc.toObject({ getters: true })
|
|
3435
|
+
*
|
|
3436
|
+
* To apply these options to every document of your schema by default, set your [schemas](#schema_Schema) `toObject` option to the same argument.
|
|
3437
|
+
*
|
|
3438
|
+
* schema.set('toObject', { virtuals: true })
|
|
3439
|
+
*
|
|
3440
|
+
* ####Transform
|
|
3441
|
+
*
|
|
3442
|
+
* We may need to perform a transformation of the resulting object based on some criteria, say to remove some sensitive information or return a custom object. In this case we set the optional `transform` function.
|
|
3443
|
+
*
|
|
3444
|
+
* Transform functions receive three arguments
|
|
3445
|
+
*
|
|
3446
|
+
* function (doc, ret, options) {}
|
|
3447
|
+
*
|
|
3448
|
+
* - `doc` The mongoose document which is being converted
|
|
3449
|
+
* - `ret` The plain object representation which has been converted
|
|
3450
|
+
* - `options` The options in use (either schema options or the options passed inline)
|
|
3451
|
+
*
|
|
3452
|
+
* ####Example
|
|
3453
|
+
*
|
|
3454
|
+
* // specify the transform schema option
|
|
3455
|
+
* if (!schema.options.toObject) schema.options.toObject = {};
|
|
3456
|
+
* schema.options.toObject.transform = function (doc, ret, options) {
|
|
3457
|
+
* // remove the _id of every document before returning the result
|
|
3458
|
+
* delete ret._id;
|
|
3459
|
+
* return ret;
|
|
3460
|
+
* }
|
|
3461
|
+
*
|
|
3462
|
+
* // without the transformation in the schema
|
|
3463
|
+
* doc.toObject(); // { _id: 'anId', name: 'Wreck-it Ralph' }
|
|
3464
|
+
*
|
|
3465
|
+
* // with the transformation
|
|
3466
|
+
* doc.toObject(); // { name: 'Wreck-it Ralph' }
|
|
3467
|
+
*
|
|
3468
|
+
* With transformations we can do a lot more than remove properties. We can even return completely new customized objects:
|
|
3469
|
+
*
|
|
3470
|
+
* if (!schema.options.toObject) schema.options.toObject = {};
|
|
3471
|
+
* schema.options.toObject.transform = function (doc, ret, options) {
|
|
3472
|
+
* return { movie: ret.name }
|
|
3473
|
+
* }
|
|
3474
|
+
*
|
|
3475
|
+
* // without the transformation in the schema
|
|
3476
|
+
* doc.toObject(); // { _id: 'anId', name: 'Wreck-it Ralph' }
|
|
3477
|
+
*
|
|
3478
|
+
* // with the transformation
|
|
3479
|
+
* doc.toObject(); // { movie: 'Wreck-it Ralph' }
|
|
3480
|
+
*
|
|
3481
|
+
* _Note: if a transform function returns `undefined`, the return value will be ignored._
|
|
3482
|
+
*
|
|
3483
|
+
* Transformations may also be applied inline, overridding any transform set in the options:
|
|
3484
|
+
*
|
|
3485
|
+
* function xform (doc, ret, options) {
|
|
3486
|
+
* return { inline: ret.name, custom: true }
|
|
3487
|
+
* }
|
|
3488
|
+
*
|
|
3489
|
+
* // pass the transform as an inline option
|
|
3490
|
+
* doc.toObject({ transform: xform }); // { inline: 'Wreck-it Ralph', custom: true }
|
|
3491
|
+
*
|
|
3492
|
+
* If you want to skip transformations, use `transform: false`:
|
|
3493
|
+
*
|
|
3494
|
+
* schema.options.toObject.hide = '_id';
|
|
3495
|
+
* schema.options.toObject.transform = function (doc, ret, options) {
|
|
3496
|
+
* if (options.hide) {
|
|
3497
|
+
* options.hide.split(' ').forEach(function (prop) {
|
|
3498
|
+
* delete ret[prop];
|
|
3499
|
+
* });
|
|
3500
|
+
* }
|
|
3501
|
+
* return ret;
|
|
3502
|
+
* }
|
|
3503
|
+
*
|
|
3504
|
+
* const doc = new Doc({ _id: 'anId', secret: 47, name: 'Wreck-it Ralph' });
|
|
3505
|
+
* doc.toObject(); // { secret: 47, name: 'Wreck-it Ralph' }
|
|
3506
|
+
* doc.toObject({ hide: 'secret _id', transform: false });// { _id: 'anId', secret: 47, name: 'Wreck-it Ralph' }
|
|
3507
|
+
* doc.toObject({ hide: 'secret _id', transform: true }); // { name: 'Wreck-it Ralph' }
|
|
3508
|
+
*
|
|
3509
|
+
* If you pass a transform in `toObject()` options, Mongoose will apply the transform
|
|
3510
|
+
* to [subdocuments](/docs/subdocs.html) in addition to the top-level document.
|
|
3511
|
+
* Similarly, `transform: false` skips transforms for all subdocuments.
|
|
3512
|
+
* Note that this is behavior is different for transforms defined in the schema:
|
|
3513
|
+
* if you define a transform in `schema.options.toObject.transform`, that transform
|
|
3514
|
+
* will **not** apply to subdocuments.
|
|
3515
|
+
*
|
|
3516
|
+
* const memberSchema = new Schema({ name: String, email: String });
|
|
3517
|
+
* const groupSchema = new Schema({ members: [memberSchema], name: String, email });
|
|
3518
|
+
* const Group = mongoose.model('Group', groupSchema);
|
|
3519
|
+
*
|
|
3520
|
+
* const doc = new Group({
|
|
3521
|
+
* name: 'Engineering',
|
|
3522
|
+
* email: 'dev@mongoosejs.io',
|
|
3523
|
+
* members: [{ name: 'Val', email: 'val@mongoosejs.io' }]
|
|
3524
|
+
* });
|
|
3525
|
+
*
|
|
3526
|
+
* // Removes `email` from both top-level document **and** array elements
|
|
3527
|
+
* // { name: 'Engineering', members: [{ name: 'Val' }] }
|
|
3528
|
+
* doc.toObject({ transform: (doc, ret) => { delete ret.email; return ret; } });
|
|
3529
|
+
*
|
|
3530
|
+
* Transforms, like all of these options, are also available for `toJSON`. See [this guide to `JSON.stringify()`](https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript.html) to learn why `toJSON()` and `toObject()` are separate functions.
|
|
3531
|
+
*
|
|
3532
|
+
* See [schema options](/docs/guide.html#toObject) for some more details.
|
|
3533
|
+
*
|
|
3534
|
+
* _During save, no custom options are applied to the document before being sent to the database._
|
|
3535
|
+
*
|
|
3536
|
+
* @param {Object} [options]
|
|
3537
|
+
* @param {Boolean} [options.getters=false] if true, apply all getters, including virtuals
|
|
3538
|
+
* @param {Boolean} [options.virtuals=false] if true, apply virtuals, including aliases. Use `{ getters: true, virtuals: false }` to just apply getters, not virtuals
|
|
3539
|
+
* @param {Boolean} [options.aliases=true] if `options.virtuals = true`, you can set `options.aliases = false` to skip applying aliases. This option is a no-op if `options.virtuals = false`.
|
|
3540
|
+
* @param {Boolean} [options.minimize=true] if true, omit any empty objects from the output
|
|
3541
|
+
* @param {Function|null} [options.transform=null] if set, mongoose will call this function to allow you to transform the returned object
|
|
3542
|
+
* @param {Boolean} [options.depopulate=false] if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths.
|
|
3543
|
+
* @param {Boolean} [options.versionKey=true] if false, exclude the version key (`__v` by default) from the output
|
|
3544
|
+
* @param {Boolean} [options.flattenMaps=false] if true, convert Maps to POJOs. Useful if you want to `JSON.stringify()` the result of `toObject()`.
|
|
3545
|
+
* @param {Boolean} [options.useProjection=false] - If true, omits fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema.
|
|
3546
|
+
* @return {Object} js object
|
|
3547
|
+
* @see mongodb.Binary http://mongodb.github.com/node-mongodb-native/api-bson-generated/binary.html
|
|
3548
|
+
* @api public
|
|
3549
|
+
* @memberOf Document
|
|
3550
|
+
* @instance
|
|
3551
|
+
*/
|
|
3552
|
+
|
|
3553
|
+
Document.prototype.toObject = function(options) {
|
|
3554
|
+
return this.$toObject(options);
|
|
3555
|
+
};
|
|
3556
|
+
|
|
3557
|
+
/*!
|
|
3558
|
+
* Minimizes an object, removing undefined values and empty objects
|
|
3559
|
+
*
|
|
3560
|
+
* @param {Object} object to minimize
|
|
3561
|
+
* @return {Object}
|
|
3562
|
+
*/
|
|
3563
|
+
|
|
3564
|
+
function minimize(obj) {
|
|
3565
|
+
const keys = Object.keys(obj);
|
|
3566
|
+
let i = keys.length;
|
|
3567
|
+
let hasKeys;
|
|
3568
|
+
let key;
|
|
3569
|
+
let val;
|
|
3570
|
+
|
|
3571
|
+
while (i--) {
|
|
3572
|
+
key = keys[i];
|
|
3573
|
+
val = obj[key];
|
|
3574
|
+
|
|
3575
|
+
if (utils.isObject(val) && !Buffer.isBuffer(val)) {
|
|
3576
|
+
obj[key] = minimize(val);
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
if (undefined === obj[key]) {
|
|
3580
|
+
delete obj[key];
|
|
3581
|
+
continue;
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
hasKeys = true;
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
return hasKeys
|
|
3588
|
+
? obj
|
|
3589
|
+
: undefined;
|
|
3590
|
+
}
|
|
3591
|
+
|
|
3592
|
+
/*!
|
|
3593
|
+
* Applies virtuals properties to `json`.
|
|
3594
|
+
*/
|
|
3595
|
+
|
|
3596
|
+
function applyVirtuals(self, json, options, toObjectOptions) {
|
|
3597
|
+
const schema = self.$__schema;
|
|
3598
|
+
const paths = Object.keys(schema.virtuals);
|
|
3599
|
+
let i = paths.length;
|
|
3600
|
+
const numPaths = i;
|
|
3601
|
+
let path;
|
|
3602
|
+
let assignPath;
|
|
3603
|
+
let cur = self._doc;
|
|
3604
|
+
let v;
|
|
3605
|
+
const aliases = get(toObjectOptions, 'aliases', true);
|
|
3606
|
+
|
|
3607
|
+
let virtualsToApply = null;
|
|
3608
|
+
if (Array.isArray(options.virtuals)) {
|
|
3609
|
+
virtualsToApply = new Set(options.virtuals);
|
|
3610
|
+
}
|
|
3611
|
+
else if (options.virtuals && options.virtuals.pathsToSkip) {
|
|
3612
|
+
virtualsToApply = new Set(paths);
|
|
3613
|
+
for (let i = 0; i < options.virtuals.pathsToSkip.length; i++) {
|
|
3614
|
+
if (virtualsToApply.has(options.virtuals.pathsToSkip[i])) {
|
|
3615
|
+
virtualsToApply.delete(options.virtuals.pathsToSkip[i]);
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
|
|
3620
|
+
if (!cur) {
|
|
3621
|
+
return json;
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
options = options || {};
|
|
3625
|
+
for (i = 0; i < numPaths; ++i) {
|
|
3626
|
+
path = paths[i];
|
|
3627
|
+
|
|
3628
|
+
if (virtualsToApply != null && !virtualsToApply.has(path)) {
|
|
3629
|
+
continue;
|
|
3630
|
+
}
|
|
3631
|
+
|
|
3632
|
+
// Allow skipping aliases with `toObject({ virtuals: true, aliases: false })`
|
|
3633
|
+
if (!aliases && schema.aliases.hasOwnProperty(path)) {
|
|
3634
|
+
continue;
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
// We may be applying virtuals to a nested object, for example if calling
|
|
3638
|
+
// `doc.nestedProp.toJSON()`. If so, the path we assign to, `assignPath`,
|
|
3639
|
+
// will be a trailing substring of the `path`.
|
|
3640
|
+
assignPath = path;
|
|
3641
|
+
if (options.path != null) {
|
|
3642
|
+
if (!path.startsWith(options.path + '.')) {
|
|
3643
|
+
continue;
|
|
3644
|
+
}
|
|
3645
|
+
assignPath = path.substr(options.path.length + 1);
|
|
3646
|
+
}
|
|
3647
|
+
const parts = assignPath.split('.');
|
|
3648
|
+
v = clone(self.get(path), options);
|
|
3649
|
+
if (v === void 0) {
|
|
3650
|
+
continue;
|
|
3651
|
+
}
|
|
3652
|
+
const plen = parts.length;
|
|
3653
|
+
cur = json;
|
|
3654
|
+
for (let j = 0; j < plen - 1; ++j) {
|
|
3655
|
+
cur[parts[j]] = cur[parts[j]] || {};
|
|
3656
|
+
cur = cur[parts[j]];
|
|
3657
|
+
}
|
|
3658
|
+
cur[parts[plen - 1]] = v;
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
return json;
|
|
3662
|
+
}
|
|
3663
|
+
|
|
3664
|
+
|
|
3665
|
+
/*!
|
|
3666
|
+
* Applies virtuals properties to `json`.
|
|
3667
|
+
*
|
|
3668
|
+
* @param {Document} self
|
|
3669
|
+
* @param {Object} json
|
|
3670
|
+
* @return {Object} `json`
|
|
3671
|
+
*/
|
|
3672
|
+
|
|
3673
|
+
function applyGetters(self, json, options) {
|
|
3674
|
+
const schema = self.$__schema;
|
|
3675
|
+
const paths = Object.keys(schema.paths);
|
|
3676
|
+
let i = paths.length;
|
|
3677
|
+
let path;
|
|
3678
|
+
let cur = self._doc;
|
|
3679
|
+
let v;
|
|
3680
|
+
|
|
3681
|
+
if (!cur) {
|
|
3682
|
+
return json;
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
while (i--) {
|
|
3686
|
+
path = paths[i];
|
|
3687
|
+
|
|
3688
|
+
const parts = path.split('.');
|
|
3689
|
+
const plen = parts.length;
|
|
3690
|
+
const last = plen - 1;
|
|
3691
|
+
let branch = json;
|
|
3692
|
+
let part;
|
|
3693
|
+
cur = self._doc;
|
|
3694
|
+
|
|
3695
|
+
if (!self.$__isSelected(path)) {
|
|
3696
|
+
continue;
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
for (let ii = 0; ii < plen; ++ii) {
|
|
3700
|
+
part = parts[ii];
|
|
3701
|
+
v = cur[part];
|
|
3702
|
+
if (ii === last) {
|
|
3703
|
+
const val = self.get(path);
|
|
3704
|
+
branch[part] = clone(val, options);
|
|
3705
|
+
} else if (v == null) {
|
|
3706
|
+
if (part in cur) {
|
|
3707
|
+
branch[part] = v;
|
|
3708
|
+
}
|
|
3709
|
+
break;
|
|
3710
|
+
} else {
|
|
3711
|
+
branch = branch[part] || (branch[part] = {});
|
|
3712
|
+
}
|
|
3713
|
+
cur = v;
|
|
3714
|
+
}
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
return json;
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
/*!
|
|
3721
|
+
* Applies schema type transforms to `json`.
|
|
3722
|
+
*
|
|
3723
|
+
* @param {Document} self
|
|
3724
|
+
* @param {Object} json
|
|
3725
|
+
* @return {Object} `json`
|
|
3726
|
+
*/
|
|
3727
|
+
|
|
3728
|
+
function applySchemaTypeTransforms(self, json) {
|
|
3729
|
+
const schema = self.$__schema;
|
|
3730
|
+
const paths = Object.keys(schema.paths || {});
|
|
3731
|
+
const cur = self._doc;
|
|
3732
|
+
|
|
3733
|
+
if (!cur) {
|
|
3734
|
+
return json;
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3737
|
+
for (const path of paths) {
|
|
3738
|
+
const schematype = schema.paths[path];
|
|
3739
|
+
if (typeof schematype.options.transform === 'function') {
|
|
3740
|
+
const val = self.get(path);
|
|
3741
|
+
const transformedValue = schematype.options.transform.call(self, val);
|
|
3742
|
+
throwErrorIfPromise(path, transformedValue);
|
|
3743
|
+
utils.setValue(path, transformedValue, json);
|
|
3744
|
+
} else if (schematype.$embeddedSchemaType != null &&
|
|
3745
|
+
typeof schematype.$embeddedSchemaType.options.transform === 'function') {
|
|
3746
|
+
const vals = [].concat(self.get(path));
|
|
3747
|
+
const transform = schematype.$embeddedSchemaType.options.transform;
|
|
3748
|
+
for (let i = 0; i < vals.length; ++i) {
|
|
3749
|
+
const transformedValue = transform.call(self, vals[i]);
|
|
3750
|
+
vals[i] = transformedValue;
|
|
3751
|
+
throwErrorIfPromise(path, transformedValue);
|
|
3752
|
+
}
|
|
3753
|
+
|
|
3754
|
+
json[path] = vals;
|
|
3755
|
+
}
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3758
|
+
return json;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
function throwErrorIfPromise(path, transformedValue) {
|
|
3762
|
+
if (isPromise_1(transformedValue)) {
|
|
3763
|
+
throw new Error('`transform` function must be synchronous, but the transform on path `' + path + '` returned a promise.');
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
/*!
|
|
3768
|
+
* ignore
|
|
3769
|
+
*/
|
|
3770
|
+
|
|
3771
|
+
function omitDeselectedFields(self, json) {
|
|
3772
|
+
const schema = self.$__schema;
|
|
3773
|
+
const paths = Object.keys(schema.paths || {});
|
|
3774
|
+
const cur = self._doc;
|
|
3775
|
+
|
|
3776
|
+
if (!cur) {
|
|
3777
|
+
return json;
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
let selected = self.$__.selected;
|
|
3781
|
+
if (selected === void 0) {
|
|
3782
|
+
selected = {};
|
|
3783
|
+
queryhelpers.applyPaths(selected, schema);
|
|
3784
|
+
}
|
|
3785
|
+
if (selected == null || Object.keys(selected).length === 0) {
|
|
3786
|
+
return json;
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3789
|
+
for (const path of paths) {
|
|
3790
|
+
if (selected[path] != null && !selected[path]) {
|
|
3791
|
+
delete json[path];
|
|
3792
|
+
}
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
return json;
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
/**
|
|
3799
|
+
* The return value of this method is used in calls to JSON.stringify(doc).
|
|
3800
|
+
*
|
|
3801
|
+
* This method accepts the same options as [Document#toObject](#document_Document-toObject). To apply the options to every document of your schema by default, set your [schemas](#schema_Schema) `toJSON` option to the same argument.
|
|
3802
|
+
*
|
|
3803
|
+
* schema.set('toJSON', { virtuals: true })
|
|
3804
|
+
*
|
|
3805
|
+
* See [schema options](/docs/guide.html#toJSON) for details.
|
|
3806
|
+
*
|
|
3807
|
+
* @param {Object} options
|
|
3808
|
+
* @return {Object}
|
|
3809
|
+
* @see Document#toObject #document_Document-toObject
|
|
3810
|
+
* @see JSON.stringify() in JavaScript https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript.html
|
|
3811
|
+
* @api public
|
|
3812
|
+
* @memberOf Document
|
|
3813
|
+
* @instance
|
|
3814
|
+
*/
|
|
3815
|
+
|
|
3816
|
+
Document.prototype.toJSON = function(options) {
|
|
3817
|
+
return this.$toObject(options, true);
|
|
3818
|
+
};
|
|
3819
|
+
|
|
3820
|
+
/**
|
|
3821
|
+
* If this document is a subdocument or populated document, returns the document's
|
|
3822
|
+
* parent. Returns `undefined` otherwise.
|
|
3823
|
+
*
|
|
3824
|
+
* @api public
|
|
3825
|
+
* @method parent
|
|
3826
|
+
* @memberOf Document
|
|
3827
|
+
* @instance
|
|
3828
|
+
*/
|
|
3829
|
+
|
|
3830
|
+
Document.prototype.parent = function() {
|
|
3831
|
+
return this.$__.parent;
|
|
3832
|
+
};
|
|
3833
|
+
|
|
3834
|
+
/**
|
|
3835
|
+
* Alias for `parent()`. If this document is a subdocument or populated
|
|
3836
|
+
* document, returns the document's parent. Returns `undefined` otherwise.
|
|
3837
|
+
*
|
|
3838
|
+
* @api public
|
|
3839
|
+
* @method $parent
|
|
3840
|
+
* @memberOf Document
|
|
3841
|
+
* @instance
|
|
3842
|
+
*/
|
|
3843
|
+
|
|
3844
|
+
Document.prototype.$parent = Document.prototype.parent;
|
|
3845
|
+
|
|
3846
|
+
/**
|
|
3847
|
+
* Helper for console.log
|
|
3848
|
+
*
|
|
3849
|
+
* @api public
|
|
3850
|
+
* @method inspect
|
|
3851
|
+
* @memberOf Document
|
|
3852
|
+
* @instance
|
|
3853
|
+
*/
|
|
3854
|
+
|
|
3855
|
+
Document.prototype.inspect = function(options) {
|
|
3856
|
+
const isPOJO = utils.isPOJO(options);
|
|
3857
|
+
let opts;
|
|
3858
|
+
if (isPOJO) {
|
|
3859
|
+
opts = options;
|
|
3860
|
+
opts.minimize = false;
|
|
3861
|
+
}
|
|
3862
|
+
const ret = this.toObject(opts);
|
|
3863
|
+
|
|
3864
|
+
if (ret == null) {
|
|
3865
|
+
// If `toObject()` returns null, `this` is still an object, so if `inspect()`
|
|
3866
|
+
// prints out null this can cause some serious confusion. See gh-7942.
|
|
3867
|
+
return 'MongooseDocument { ' + ret + ' }';
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
return ret;
|
|
3871
|
+
};
|
|
3872
|
+
|
|
3873
|
+
if (inspect.custom) {
|
|
3874
|
+
/*!
|
|
3875
|
+
* Avoid Node deprecation warning DEP0079
|
|
3876
|
+
*/
|
|
3877
|
+
|
|
3878
|
+
Document.prototype[inspect.custom] = Document.prototype.inspect;
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3881
|
+
/**
|
|
3882
|
+
* Helper for console.log
|
|
3883
|
+
*
|
|
3884
|
+
* @api public
|
|
3885
|
+
* @method toString
|
|
3886
|
+
* @memberOf Document
|
|
3887
|
+
* @instance
|
|
3888
|
+
*/
|
|
3889
|
+
|
|
3890
|
+
Document.prototype.toString = function() {
|
|
3891
|
+
const ret = this.inspect();
|
|
3892
|
+
if (typeof ret === 'string') {
|
|
3893
|
+
return ret;
|
|
3894
|
+
}
|
|
3895
|
+
return inspect(ret);
|
|
3896
|
+
};
|
|
3897
|
+
|
|
3898
|
+
/**
|
|
3899
|
+
* Returns true if this document is equal to another document.
|
|
3900
|
+
*
|
|
3901
|
+
* Documents are considered equal when they have matching `_id`s, unless neither
|
|
3902
|
+
* document has an `_id`, in which case this function falls back to using
|
|
3903
|
+
* `deepEqual()`.
|
|
3904
|
+
*
|
|
3905
|
+
* @param {Document} doc a document to compare
|
|
3906
|
+
* @return {Boolean}
|
|
3907
|
+
* @api public
|
|
3908
|
+
* @memberOf Document
|
|
3909
|
+
* @instance
|
|
3910
|
+
*/
|
|
3911
|
+
|
|
3912
|
+
Document.prototype.equals = function(doc) {
|
|
3913
|
+
if (!doc) {
|
|
3914
|
+
return false;
|
|
3915
|
+
}
|
|
3916
|
+
|
|
3917
|
+
const tid = this.$__getValue('_id');
|
|
3918
|
+
const docid = doc.$__ != null ? doc.$__getValue('_id') : doc;
|
|
3919
|
+
if (!tid && !docid) {
|
|
3920
|
+
return deepEqual(this, doc);
|
|
3921
|
+
}
|
|
3922
|
+
return tid && tid.equals
|
|
3923
|
+
? tid.equals(docid)
|
|
3924
|
+
: tid === docid;
|
|
3925
|
+
};
|
|
3926
|
+
|
|
3927
|
+
/**
|
|
3928
|
+
* Populates document references, executing the `callback` when complete.
|
|
3929
|
+
* If you want to use promises instead, use this function with
|
|
3930
|
+
* [`execPopulate()`](#document_Document-execPopulate)
|
|
3931
|
+
*
|
|
3932
|
+
* ####Example:
|
|
3933
|
+
*
|
|
3934
|
+
* doc
|
|
3935
|
+
* .populate('company')
|
|
3936
|
+
* .populate({
|
|
3937
|
+
* path: 'notes',
|
|
3938
|
+
* match: /airline/,
|
|
3939
|
+
* select: 'text',
|
|
3940
|
+
* model: 'modelName'
|
|
3941
|
+
* options: opts
|
|
3942
|
+
* }, function (err, user) {
|
|
3943
|
+
* assert(doc._id === user._id) // the document itself is passed
|
|
3944
|
+
* })
|
|
3945
|
+
*
|
|
3946
|
+
* // summary
|
|
3947
|
+
* doc.populate(path) // not executed
|
|
3948
|
+
* doc.populate(options); // not executed
|
|
3949
|
+
* doc.populate(path, callback) // executed
|
|
3950
|
+
* doc.populate(options, callback); // executed
|
|
3951
|
+
* doc.populate(callback); // executed
|
|
3952
|
+
* doc.populate(options).execPopulate() // executed, returns promise
|
|
3953
|
+
*
|
|
3954
|
+
*
|
|
3955
|
+
* ####NOTE:
|
|
3956
|
+
*
|
|
3957
|
+
* Population does not occur unless a `callback` is passed *or* you explicitly
|
|
3958
|
+
* call `execPopulate()`.
|
|
3959
|
+
* Passing the same path a second time will overwrite the previous path options.
|
|
3960
|
+
* See [Model.populate()](#model_Model.populate) for explaination of options.
|
|
3961
|
+
*
|
|
3962
|
+
* @see Model.populate #model_Model.populate
|
|
3963
|
+
* @see Document.execPopulate #document_Document-execPopulate
|
|
3964
|
+
* @param {String|Object} [path] The path to populate or an options object
|
|
3965
|
+
* @param {Function} [callback] When passed, population is invoked
|
|
3966
|
+
* @api public
|
|
3967
|
+
* @return {Document} this
|
|
3968
|
+
* @memberOf Document
|
|
3969
|
+
* @instance
|
|
3970
|
+
*/
|
|
3971
|
+
|
|
3972
|
+
Document.prototype.populate = function populate() {
|
|
3973
|
+
if (arguments.length === 0) {
|
|
3974
|
+
return this;
|
|
3975
|
+
}
|
|
3976
|
+
|
|
3977
|
+
const pop = this.$__.populate || (this.$__.populate = {});
|
|
3978
|
+
const args = utils.args(arguments);
|
|
3979
|
+
let fn;
|
|
3980
|
+
|
|
3981
|
+
if (typeof args[args.length - 1] === 'function') {
|
|
3982
|
+
fn = args.pop();
|
|
3983
|
+
}
|
|
3984
|
+
|
|
3985
|
+
// allow `doc.populate(callback)`
|
|
3986
|
+
if (args.length) {
|
|
3987
|
+
// use hash to remove duplicate paths
|
|
3988
|
+
const res = utils.populate.apply(null, args);
|
|
3989
|
+
for (const populateOptions of res) {
|
|
3990
|
+
pop[populateOptions.path] = populateOptions;
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
|
|
3994
|
+
if (fn) {
|
|
3995
|
+
const paths = utils.object.vals(pop);
|
|
3996
|
+
this.$__.populate = undefined;
|
|
3997
|
+
let topLevelModel = this.constructor;
|
|
3998
|
+
if (this.$__isNested) {
|
|
3999
|
+
topLevelModel = this.$__[scopeSymbol].constructor;
|
|
4000
|
+
const nestedPath = this.$__.nestedPath;
|
|
4001
|
+
paths.forEach(function(populateOptions) {
|
|
4002
|
+
populateOptions.path = nestedPath + '.' + populateOptions.path;
|
|
4003
|
+
});
|
|
4004
|
+
}
|
|
4005
|
+
|
|
4006
|
+
// Use `$session()` by default if the document has an associated session
|
|
4007
|
+
// See gh-6754
|
|
4008
|
+
if (this.$session() != null) {
|
|
4009
|
+
const session = this.$session();
|
|
4010
|
+
paths.forEach(path => {
|
|
4011
|
+
if (path.options == null) {
|
|
4012
|
+
path.options = { session: session };
|
|
4013
|
+
return;
|
|
4014
|
+
}
|
|
4015
|
+
if (!('session' in path.options)) {
|
|
4016
|
+
path.options.session = session;
|
|
4017
|
+
}
|
|
4018
|
+
});
|
|
4019
|
+
}
|
|
4020
|
+
|
|
4021
|
+
topLevelModel.populate(this, paths, fn);
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
return this;
|
|
4025
|
+
};
|
|
4026
|
+
|
|
4027
|
+
/**
|
|
4028
|
+
* Gets all populated documents associated with this document.
|
|
4029
|
+
*
|
|
4030
|
+
* @api public
|
|
4031
|
+
* @return {Array<Document>} array of populated documents. Empty array if there are no populated documents associated with this document.
|
|
4032
|
+
* @memberOf Document
|
|
4033
|
+
* @instance
|
|
4034
|
+
*/
|
|
4035
|
+
Document.prototype.$getPopulatedDocs = function $getPopulatedDocs() {
|
|
4036
|
+
let keys = [];
|
|
4037
|
+
if (this.$__.populated != null) {
|
|
4038
|
+
keys = keys.concat(Object.keys(this.$__.populated));
|
|
4039
|
+
}
|
|
4040
|
+
if (this.$$populatedVirtuals != null) {
|
|
4041
|
+
keys = keys.concat(Object.keys(this.$$populatedVirtuals));
|
|
4042
|
+
}
|
|
4043
|
+
let result = [];
|
|
4044
|
+
for (const key of keys) {
|
|
4045
|
+
const value = this.get(key);
|
|
4046
|
+
if (Array.isArray(value)) {
|
|
4047
|
+
result = result.concat(value);
|
|
4048
|
+
} else if (value instanceof Document) {
|
|
4049
|
+
result.push(value);
|
|
4050
|
+
}
|
|
4051
|
+
}
|
|
4052
|
+
return result;
|
|
4053
|
+
};
|
|
4054
|
+
|
|
4055
|
+
/**
|
|
4056
|
+
* Explicitly executes population and returns a promise. Useful for promises integration.
|
|
4057
|
+
*
|
|
4058
|
+
* ####Example:
|
|
4059
|
+
*
|
|
4060
|
+
* const promise = doc.
|
|
4061
|
+
* populate('company').
|
|
4062
|
+
* populate({
|
|
4063
|
+
* path: 'notes',
|
|
4064
|
+
* match: /airline/,
|
|
4065
|
+
* select: 'text',
|
|
4066
|
+
* model: 'modelName'
|
|
4067
|
+
* options: opts
|
|
4068
|
+
* }).
|
|
4069
|
+
* execPopulate();
|
|
4070
|
+
*
|
|
4071
|
+
* // summary
|
|
4072
|
+
* doc.execPopulate().then(resolve, reject);
|
|
4073
|
+
*
|
|
4074
|
+
* // you can also use doc.execPopulate(options) as a shorthand for
|
|
4075
|
+
* // doc.populate(options).execPopulate()
|
|
4076
|
+
*
|
|
4077
|
+
*
|
|
4078
|
+
* ####Example:
|
|
4079
|
+
* const promise = doc.execPopulate({ path: 'company', select: 'employees' });
|
|
4080
|
+
*
|
|
4081
|
+
* // summary
|
|
4082
|
+
* promise.then(resolve,reject);
|
|
4083
|
+
*
|
|
4084
|
+
* @see Document.populate #document_Document-populate
|
|
4085
|
+
* @api public
|
|
4086
|
+
* @param {Function} [callback] optional callback. If specified, a promise will **not** be returned
|
|
4087
|
+
* @return {Promise} promise that resolves to the document when population is done
|
|
4088
|
+
* @memberOf Document
|
|
4089
|
+
* @instance
|
|
4090
|
+
*/
|
|
4091
|
+
|
|
4092
|
+
Document.prototype.execPopulate = function(callback) {
|
|
4093
|
+
const isUsingShorthand = callback != null && typeof callback !== 'function';
|
|
4094
|
+
if (isUsingShorthand) {
|
|
4095
|
+
return this.populate.apply(this, arguments).execPopulate();
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
return promiseOrCallback(callback, cb => {
|
|
4099
|
+
this.populate(cb);
|
|
4100
|
+
}, this.constructor.events);
|
|
4101
|
+
};
|
|
4102
|
+
|
|
4103
|
+
/**
|
|
4104
|
+
* Gets _id(s) used during population of the given `path`.
|
|
4105
|
+
*
|
|
4106
|
+
* ####Example:
|
|
4107
|
+
*
|
|
4108
|
+
* Model.findOne().populate('author').exec(function (err, doc) {
|
|
4109
|
+
* console.log(doc.author.name) // Dr.Seuss
|
|
4110
|
+
* console.log(doc.populated('author')) // '5144cf8050f071d979c118a7'
|
|
4111
|
+
* })
|
|
4112
|
+
*
|
|
4113
|
+
* If the path was not populated, returns `undefined`.
|
|
4114
|
+
*
|
|
4115
|
+
* @param {String} path
|
|
4116
|
+
* @return {Array|ObjectId|Number|Buffer|String|undefined}
|
|
4117
|
+
* @memberOf Document
|
|
4118
|
+
* @instance
|
|
4119
|
+
* @api public
|
|
4120
|
+
*/
|
|
4121
|
+
|
|
4122
|
+
Document.prototype.populated = function(path, val, options) {
|
|
4123
|
+
// val and options are internal
|
|
4124
|
+
if (val == null || val === true) {
|
|
4125
|
+
if (!this.$__.populated) {
|
|
4126
|
+
return undefined;
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
// Map paths can be populated with either `path.$*` or just `path`
|
|
4130
|
+
const _path = path.endsWith('.$*') ? path.replace(/\.\$\*$/, '') : path;
|
|
4131
|
+
|
|
4132
|
+
const v = this.$__.populated[_path];
|
|
4133
|
+
if (v) {
|
|
4134
|
+
return val === true ? v : v.value;
|
|
4135
|
+
}
|
|
4136
|
+
return undefined;
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
this.$__.populated || (this.$__.populated = {});
|
|
4140
|
+
this.$__.populated[path] = { value: val, options: options };
|
|
4141
|
+
|
|
4142
|
+
// If this was a nested populate, make sure each populated doc knows
|
|
4143
|
+
// about its populated children (gh-7685)
|
|
4144
|
+
const pieces = path.split('.');
|
|
4145
|
+
for (let i = 0; i < pieces.length - 1; ++i) {
|
|
4146
|
+
const subpath = pieces.slice(0, i + 1).join('.');
|
|
4147
|
+
const subdoc = this.get(subpath);
|
|
4148
|
+
if (subdoc != null && subdoc.$__ != null && this.populated(subpath)) {
|
|
4149
|
+
const rest = pieces.slice(i + 1).join('.');
|
|
4150
|
+
subdoc.populated(rest, val, options);
|
|
4151
|
+
// No need to continue because the above recursion should take care of
|
|
4152
|
+
// marking the rest of the docs as populated
|
|
4153
|
+
break;
|
|
4154
|
+
}
|
|
4155
|
+
}
|
|
4156
|
+
|
|
4157
|
+
return val;
|
|
4158
|
+
};
|
|
4159
|
+
|
|
4160
|
+
/**
|
|
4161
|
+
* Takes a populated field and returns it to its unpopulated state.
|
|
4162
|
+
*
|
|
4163
|
+
* ####Example:
|
|
4164
|
+
*
|
|
4165
|
+
* Model.findOne().populate('author').exec(function (err, doc) {
|
|
4166
|
+
* console.log(doc.author.name); // Dr.Seuss
|
|
4167
|
+
* console.log(doc.depopulate('author'));
|
|
4168
|
+
* console.log(doc.author); // '5144cf8050f071d979c118a7'
|
|
4169
|
+
* })
|
|
4170
|
+
*
|
|
4171
|
+
* If the path was not populated, this is a no-op.
|
|
4172
|
+
*
|
|
4173
|
+
* @param {String} path
|
|
4174
|
+
* @return {Document} this
|
|
4175
|
+
* @see Document.populate #document_Document-populate
|
|
4176
|
+
* @api public
|
|
4177
|
+
* @memberOf Document
|
|
4178
|
+
* @instance
|
|
4179
|
+
*/
|
|
4180
|
+
|
|
4181
|
+
Document.prototype.depopulate = function(path) {
|
|
4182
|
+
if (typeof path === 'string') {
|
|
4183
|
+
path = path.split(' ');
|
|
4184
|
+
}
|
|
4185
|
+
|
|
4186
|
+
let populatedIds;
|
|
4187
|
+
const virtualKeys = this.$$populatedVirtuals ? Object.keys(this.$$populatedVirtuals) : [];
|
|
4188
|
+
const populated = get(this, '$__.populated', {});
|
|
4189
|
+
|
|
4190
|
+
if (arguments.length === 0) {
|
|
4191
|
+
// Depopulate all
|
|
4192
|
+
for (const virtualKey of virtualKeys) {
|
|
4193
|
+
delete this.$$populatedVirtuals[virtualKey];
|
|
4194
|
+
delete this._doc[virtualKey];
|
|
4195
|
+
delete populated[virtualKey];
|
|
4196
|
+
}
|
|
4197
|
+
|
|
4198
|
+
const keys = Object.keys(populated);
|
|
4199
|
+
|
|
4200
|
+
for (const key of keys) {
|
|
4201
|
+
populatedIds = this.populated(key);
|
|
4202
|
+
if (!populatedIds) {
|
|
4203
|
+
continue;
|
|
4204
|
+
}
|
|
4205
|
+
delete populated[key];
|
|
4206
|
+
this.$set(key, populatedIds);
|
|
4207
|
+
}
|
|
4208
|
+
return this;
|
|
4209
|
+
}
|
|
4210
|
+
|
|
4211
|
+
for (const singlePath of path) {
|
|
4212
|
+
populatedIds = this.populated(singlePath);
|
|
4213
|
+
delete populated[singlePath];
|
|
4214
|
+
|
|
4215
|
+
if (virtualKeys.indexOf(singlePath) !== -1) {
|
|
4216
|
+
delete this.$$populatedVirtuals[singlePath];
|
|
4217
|
+
delete this._doc[singlePath];
|
|
4218
|
+
} else if (populatedIds) {
|
|
4219
|
+
this.$set(singlePath, populatedIds);
|
|
4220
|
+
}
|
|
4221
|
+
}
|
|
4222
|
+
return this;
|
|
4223
|
+
};
|
|
4224
|
+
|
|
4225
|
+
|
|
4226
|
+
/**
|
|
4227
|
+
* Returns the full path to this document.
|
|
4228
|
+
*
|
|
4229
|
+
* @param {String} [path]
|
|
4230
|
+
* @return {String}
|
|
4231
|
+
* @api private
|
|
4232
|
+
* @method $__fullPath
|
|
4233
|
+
* @memberOf Document
|
|
4234
|
+
* @instance
|
|
4235
|
+
*/
|
|
4236
|
+
|
|
4237
|
+
Document.prototype.$__fullPath = function(path) {
|
|
4238
|
+
// overridden in SubDocuments
|
|
4239
|
+
return path || '';
|
|
4240
|
+
};
|
|
4241
|
+
|
|
4242
|
+
/**
|
|
4243
|
+
* Returns the changes that happened to the document
|
|
4244
|
+
* in the format that will be sent to MongoDB.
|
|
4245
|
+
*
|
|
4246
|
+
* #### Example:
|
|
4247
|
+
*
|
|
4248
|
+
* const userSchema = new Schema({
|
|
4249
|
+
* name: String,
|
|
4250
|
+
* age: Number,
|
|
4251
|
+
* country: String
|
|
4252
|
+
* });
|
|
4253
|
+
* const User = mongoose.model('User', userSchema);
|
|
4254
|
+
* const user = await User.create({
|
|
4255
|
+
* name: 'Hafez',
|
|
4256
|
+
* age: 25,
|
|
4257
|
+
* country: 'Egypt'
|
|
4258
|
+
* });
|
|
4259
|
+
*
|
|
4260
|
+
* // returns an empty object, no changes happened yet
|
|
4261
|
+
* user.getChanges(); // { }
|
|
4262
|
+
*
|
|
4263
|
+
* user.country = undefined;
|
|
4264
|
+
* user.age = 26;
|
|
4265
|
+
*
|
|
4266
|
+
* user.getChanges(); // { $set: { age: 26 }, { $unset: { country: 1 } } }
|
|
4267
|
+
*
|
|
4268
|
+
* await user.save();
|
|
4269
|
+
*
|
|
4270
|
+
* user.getChanges(); // { }
|
|
4271
|
+
*
|
|
4272
|
+
* Modifying the object that `getChanges()` returns does not affect the document's
|
|
4273
|
+
* change tracking state. Even if you `delete user.getChanges().$set`, Mongoose
|
|
4274
|
+
* will still send a `$set` to the server.
|
|
4275
|
+
*
|
|
4276
|
+
* @return {Object}
|
|
4277
|
+
* @api public
|
|
4278
|
+
* @method getChanges
|
|
4279
|
+
* @memberOf Document
|
|
4280
|
+
* @instance
|
|
4281
|
+
*/
|
|
4282
|
+
|
|
4283
|
+
Document.prototype.getChanges = function() {
|
|
4284
|
+
const delta = this.$__delta();
|
|
4285
|
+
const changes = delta ? delta[1] : {};
|
|
4286
|
+
return changes;
|
|
4287
|
+
};
|
|
4288
|
+
|
|
4289
|
+
/*!
|
|
4290
|
+
* Module exports.
|
|
4291
|
+
*/
|
|
4292
|
+
|
|
4293
|
+
Document.ValidationError = validation;
|
|
4294
|
+
module.exports = Document;
|
|
4295
|
+
});
|
|
4296
|
+
|
|
4297
|
+
export default document;
|
|
4298
|
+
//# sourceMappingURL=document.mjs.map
|