@nullix/zod-mongoose-studio 1.0.12 → 2.0.0
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Db4IAypj.js → 0J_bLG6U.js} +1 -1
- package/.output/public/_nuxt/{Y39o1QEi.js → 5KLjKHc1.js} +1 -1
- package/.output/public/_nuxt/{B4zoPYF-.js → B2UrsJHg.js} +1 -1
- package/.output/public/_nuxt/{BSqjh6Vk.js → BC5hGokz.js} +1 -1
- package/.output/public/_nuxt/{BS4yU4O0.js → BJwN20Xm.js} +1 -1
- package/.output/public/_nuxt/{D8_n84hl.js → BMgDPqps.js} +1 -1
- package/.output/public/_nuxt/{CqNsQbt9.js → B_sGF2qN.js} +1 -1
- package/.output/public/_nuxt/{NAqlztEN.js → BeaJ7I-K.js} +10 -10
- package/.output/public/_nuxt/{WZ0WK9cR.js → BkE1sm_1.js} +1 -1
- package/.output/public/_nuxt/{kBtP64Rx.js → CADbZwE5.js} +1 -1
- package/.output/public/_nuxt/{B8qGaxNm.js → CB0WRoVi.js} +1 -1
- package/.output/public/_nuxt/{BV6uALfO.js → CCh0PVV0.js} +1 -1
- package/.output/public/_nuxt/{CP9Z7-_9.js → Cr0GW7rA.js} +1 -1
- package/.output/public/_nuxt/{DeCqoVOS.js → DJe7Wxdv.js} +1 -1
- package/.output/public/_nuxt/{dBZQW7JD.js → DRBrUaE5.js} +1 -1
- package/.output/public/_nuxt/{Db19R32y.js → DV2n9B6m.js} +1 -1
- package/.output/public/_nuxt/{CvnpbYw0.js → DVD-jGiv.js} +1 -1
- package/.output/public/_nuxt/{BWajNATZ.js → Dk9qGA5X.js} +3 -3
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/dc761332-547d-4953-b51d-b2d453009b48.json +1 -0
- package/.output/public/_nuxt/error-404.64pZEiDn.css +1 -0
- package/.output/public/_nuxt/error-500.DHOpI0Ir.css +1 -0
- package/.output/public/_nuxt/{BoHhCIKW.js → koEZfutw.js} +3 -3
- package/.output/public/_nuxt/{B_782F4p.js → r6LdR7DN.js} +1 -1
- package/.output/public/_nuxt/{BEI71c6K.js → rEfOp38p.js} +1 -1
- package/.output/server/chunks/_/error-500.mjs.map +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{error-404-8tbBXju4.mjs → error-404-BN-7rNE4.mjs} +4 -4
- package/.output/server/chunks/build/error-404-BN-7rNE4.mjs.map +1 -0
- package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs +8 -0
- package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs.map +1 -0
- package/.output/server/chunks/build/{error-500-DxFsom1i.mjs → error-500-DhIQ-2yt.mjs} +4 -4
- package/.output/server/chunks/build/error-500-DhIQ-2yt.mjs.map +1 -0
- package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs +8 -0
- package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs.map +1 -0
- package/.output/server/chunks/build/{index-BB-Clavm.mjs → index-Dnrh1ePF.mjs} +1 -1
- package/.output/server/chunks/build/index-Dnrh1ePF.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +9 -9
- package/.output/server/chunks/build/styles.mjs +4 -4
- package/.output/server/chunks/nitro/nitro.mjs +342 -342
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs.map +1 -1
- package/.output/server/node_modules/bson/lib/bson.cjs +157 -48
- package/.output/server/node_modules/bson/package.json +9 -11
- package/.output/server/node_modules/kareem/index.js +228 -343
- package/.output/server/node_modules/kareem/package.json +3 -3
- package/.output/server/node_modules/mongodb/lib/bson.js +27 -5
- package/.output/server/node_modules/mongodb/lib/bulk/common.js +7 -9
- package/.output/server/node_modules/mongodb/lib/change_stream.js +91 -39
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js +21 -14
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/client_encryption.js +2 -5
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/errors.js +3 -1
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js +1 -1
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/state_machine.js +1 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/aws4.js +161 -0
- package/.output/server/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js +11 -58
- package/.output/server/node_modules/mongodb/lib/cmap/auth/gssapi.js +4 -6
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js +2 -16
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js +14 -23
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js +3 -3
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js +3 -3
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js +4 -3
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js +4 -3
- package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js +4 -4
- package/.output/server/node_modules/mongodb/lib/cmap/auth/plain.js +1 -1
- package/.output/server/node_modules/mongodb/lib/cmap/auth/providers.js +0 -1
- package/.output/server/node_modules/mongodb/lib/cmap/auth/scram.js +53 -40
- package/.output/server/node_modules/mongodb/lib/cmap/commands.js +46 -39
- package/.output/server/node_modules/mongodb/lib/cmap/connect.js +35 -3
- package/.output/server/node_modules/mongodb/lib/cmap/connection.js +36 -32
- package/.output/server/node_modules/mongodb/lib/cmap/connection_pool.js +67 -67
- package/.output/server/node_modules/mongodb/lib/cmap/connection_pool_events.js +3 -3
- package/.output/server/node_modules/mongodb/lib/cmap/errors.js +1 -1
- package/.output/server/node_modules/mongodb/lib/cmap/handshake/client_metadata.js +15 -13
- package/.output/server/node_modules/mongodb/lib/cmap/metrics.js +3 -3
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/compression.js +26 -10
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/constants.js +3 -1
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js +0 -1
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js +9 -9
- package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/responses.js +2 -2
- package/.output/server/node_modules/mongodb/lib/collection.js +1 -1
- package/.output/server/node_modules/mongodb/lib/connection_string.js +30 -15
- package/.output/server/node_modules/mongodb/lib/cursor/abstract_cursor.js +17 -34
- package/.output/server/node_modules/mongodb/lib/cursor/change_stream_cursor.js +2 -2
- package/.output/server/node_modules/mongodb/lib/cursor/find_cursor.js +37 -26
- package/.output/server/node_modules/mongodb/lib/cursor/run_command_cursor.js +1 -1
- package/.output/server/node_modules/mongodb/lib/db.js +6 -7
- package/.output/server/node_modules/mongodb/lib/deps.js +0 -13
- package/.output/server/node_modules/mongodb/lib/error.js +7 -10
- package/.output/server/node_modules/mongodb/lib/gridfs/download.js +7 -6
- package/.output/server/node_modules/mongodb/lib/gridfs/index.js +9 -9
- package/.output/server/node_modules/mongodb/lib/gridfs/upload.js +17 -23
- package/.output/server/node_modules/mongodb/lib/index.js +2 -4
- package/.output/server/node_modules/mongodb/lib/mongo_client.js +58 -67
- package/.output/server/node_modules/mongodb/lib/mongo_client_auth_providers.js +0 -6
- package/.output/server/node_modules/mongodb/lib/mongo_logger.js +11 -5
- package/.output/server/node_modules/mongodb/lib/mongo_types.js +1 -2
- package/.output/server/node_modules/mongodb/lib/operations/aggregate.js +0 -3
- package/.output/server/node_modules/mongodb/lib/operations/create_collection.js +0 -1
- package/.output/server/node_modules/mongodb/lib/operations/drop.js +8 -9
- package/.output/server/node_modules/mongodb/lib/operations/end_sessions.js +34 -0
- package/.output/server/node_modules/mongodb/lib/operations/execute_operation.js +121 -45
- package/.output/server/node_modules/mongodb/lib/operations/operation.js +1 -0
- package/.output/server/node_modules/mongodb/lib/read_preference.js +10 -14
- package/.output/server/node_modules/mongodb/lib/runtime_adapters.js +32 -0
- package/.output/server/node_modules/mongodb/lib/sdam/monitor.js +8 -8
- package/.output/server/node_modules/mongodb/lib/sdam/server.js +55 -43
- package/.output/server/node_modules/mongodb/lib/sdam/server_description.js +1 -1
- package/.output/server/node_modules/mongodb/lib/sdam/server_selection.js +135 -72
- package/.output/server/node_modules/mongodb/lib/sdam/srv_polling.js +3 -3
- package/.output/server/node_modules/mongodb/lib/sdam/topology.js +37 -77
- package/.output/server/node_modules/mongodb/lib/sdam/topology_description.js +1 -1
- package/.output/server/node_modules/mongodb/lib/sessions.js +150 -40
- package/.output/server/node_modules/mongodb/lib/transactions.js +2 -13
- package/.output/server/node_modules/mongodb/lib/utils.js +42 -90
- package/.output/server/node_modules/mongodb/package.json +49 -45
- package/.output/server/node_modules/mongodb-connection-string-url/lib/index.js +45 -19
- package/.output/server/node_modules/mongodb-connection-string-url/lib/redact.js +30 -19
- package/.output/server/node_modules/mongodb-connection-string-url/package.json +25 -16
- package/.output/server/node_modules/mongoose/lib/aggregate.js +108 -127
- package/.output/server/node_modules/mongoose/lib/cast/bigint.js +3 -3
- package/.output/server/node_modules/mongoose/lib/cast/boolean.js +3 -3
- package/.output/server/node_modules/mongoose/lib/cast/double.js +4 -4
- package/.output/server/node_modules/mongoose/lib/cast/int32.js +2 -2
- package/.output/server/node_modules/mongoose/lib/cast/number.js +6 -6
- package/.output/server/node_modules/mongoose/lib/cast/string.js +3 -3
- package/.output/server/node_modules/mongoose/lib/cast/uuid.js +5 -48
- package/.output/server/node_modules/mongoose/lib/cast.js +16 -24
- package/.output/server/node_modules/mongoose/lib/collection.js +6 -6
- package/.output/server/node_modules/mongoose/lib/connection.js +108 -105
- package/.output/server/node_modules/mongoose/lib/cursor/aggregationCursor.js +23 -33
- package/.output/server/node_modules/mongoose/lib/cursor/changeStream.js +60 -40
- package/.output/server/node_modules/mongoose/lib/cursor/queryCursor.js +21 -25
- package/.output/server/node_modules/mongoose/lib/document.js +712 -531
- package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +85 -130
- package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +32 -41
- package/.output/server/node_modules/mongoose/lib/error/cast.js +21 -12
- package/.output/server/node_modules/mongoose/lib/error/createCollectionsError.js +2 -2
- package/.output/server/node_modules/mongoose/lib/error/divergentArray.js +1 -1
- package/.output/server/node_modules/mongoose/lib/error/eachAsyncMultiError.js +1 -1
- package/.output/server/node_modules/mongoose/lib/error/index.js +3 -3
- package/.output/server/node_modules/mongoose/lib/error/invalidSchemaOption.js +1 -1
- package/.output/server/node_modules/mongoose/lib/error/messages.js +1 -0
- package/.output/server/node_modules/mongoose/lib/error/missingSchema.js +1 -1
- package/.output/server/node_modules/mongoose/lib/error/objectParameter.js +4 -5
- package/.output/server/node_modules/mongoose/lib/error/overwriteModel.js +1 -1
- package/.output/server/node_modules/mongoose/lib/error/setOptionError.js +3 -3
- package/.output/server/node_modules/mongoose/lib/error/strict.js +3 -3
- package/.output/server/node_modules/mongoose/lib/error/strictPopulate.js +2 -2
- package/.output/server/node_modules/mongoose/lib/error/syncIndexes.js +2 -2
- package/.output/server/node_modules/mongoose/lib/error/validation.js +2 -10
- package/.output/server/node_modules/mongoose/lib/error/validator.js +1 -1
- package/.output/server/node_modules/mongoose/lib/error/version.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +4 -4
- package/.output/server/node_modules/mongoose/lib/helpers/buildMiddlewareFilter.js +24 -0
- package/.output/server/node_modules/mongoose/lib/helpers/clone.js +35 -18
- package/.output/server/node_modules/mongoose/lib/helpers/common.js +5 -5
- package/.output/server/node_modules/mongoose/lib/helpers/cursor/eachAsync.js +4 -4
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js +10 -5
- package/.output/server/node_modules/mongoose/lib/helpers/document/applyDefaults.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/document/applyTimestamps.js +11 -10
- package/.output/server/node_modules/mongoose/lib/helpers/document/applyVirtuals.js +10 -9
- package/.output/server/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/document/compile.js +17 -14
- package/.output/server/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js +3 -3
- package/.output/server/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/document/isInPathsToSave.js +24 -0
- package/.output/server/node_modules/mongoose/lib/helpers/get.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js +3 -3
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +3 -4
- package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js +3 -3
- package/.output/server/node_modules/mongoose/lib/helpers/isBsonType.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/isMongooseObject.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/isObject.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/isSimpleValidator.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/minimize.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyHooks.js +55 -54
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyMethods.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +1 -48
- package/.output/server/node_modules/mongoose/lib/helpers/model/castBulkWrite.js +8 -12
- package/.output/server/node_modules/mongoose/lib/helpers/model/discriminator.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/parallelLimit.js +18 -36
- package/.output/server/node_modules/mongoose/lib/helpers/pluralize.js +4 -4
- package/.output/server/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +4 -11
- package/.output/server/node_modules/mongoose/lib/helpers/populate/assignVals.js +10 -10
- package/.output/server/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +3 -3
- package/.output/server/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +197 -69
- package/.output/server/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +15 -15
- package/.output/server/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js +10 -2
- package/.output/server/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js +5 -5
- package/.output/server/node_modules/mongoose/lib/helpers/printJestWarning.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/processConnectionOptions.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +3 -3
- package/.output/server/node_modules/mongoose/lib/helpers/projection/isSubpath.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/projection/parseProjection.js +9 -4
- package/.output/server/node_modules/mongoose/lib/helpers/query/cast$expr.js +8 -10
- package/.output/server/node_modules/mongoose/lib/helpers/query/castFilterPath.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/query/castUpdate.js +44 -38
- package/.output/server/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +8 -8
- package/.output/server/node_modules/mongoose/lib/helpers/query/handleImmutable.js +8 -8
- package/.output/server/node_modules/mongoose/lib/helpers/schema/applyPlugins.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +4 -2
- package/.output/server/node_modules/mongoose/lib/helpers/schema/getIndexes.js +5 -11
- package/.output/server/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/schema/handleIdOption.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/schema/idGetter.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +26 -13
- package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +60 -38
- package/.output/server/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +13 -10
- package/.output/server/node_modules/mongoose/lib/helpers/update/castArrayFilters.js +4 -4
- package/.output/server/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js +1 -1
- package/.output/server/node_modules/mongoose/lib/helpers/update/modifiedPaths.js +2 -2
- package/.output/server/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +7 -2
- package/.output/server/node_modules/mongoose/lib/helpers/updateValidators.js +58 -119
- package/.output/server/node_modules/mongoose/lib/model.js +940 -946
- package/.output/server/node_modules/mongoose/lib/mongoose.js +131 -79
- package/.output/server/node_modules/mongoose/lib/options/schemaArrayOptions.js +2 -2
- package/.output/server/node_modules/mongoose/lib/options/schemaBufferOptions.js +1 -1
- package/.output/server/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js +23 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaNumberOptions.js +3 -3
- package/.output/server/node_modules/mongoose/lib/options/schemaObjectIdOptions.js +2 -2
- package/.output/server/node_modules/mongoose/lib/options/schemaStringOptions.js +6 -6
- package/.output/server/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js +23 -0
- package/.output/server/node_modules/mongoose/lib/options/schemaTypeOptions.js +27 -13
- package/.output/server/node_modules/mongoose/lib/options/virtualOptions.js +12 -12
- package/.output/server/node_modules/mongoose/lib/plugins/index.js +0 -1
- package/.output/server/node_modules/mongoose/lib/plugins/saveSubdocs.js +84 -92
- package/.output/server/node_modules/mongoose/lib/plugins/sharding.js +33 -15
- package/.output/server/node_modules/mongoose/lib/plugins/trackTransaction.js +29 -25
- package/.output/server/node_modules/mongoose/lib/query.js +700 -548
- package/.output/server/node_modules/mongoose/lib/queryHelpers.js +34 -32
- package/.output/server/node_modules/mongoose/lib/schema/array.js +69 -113
- package/.output/server/node_modules/mongoose/lib/schema/bigint.js +18 -20
- package/.output/server/node_modules/mongoose/lib/schema/boolean.js +20 -22
- package/.output/server/node_modules/mongoose/lib/schema/buffer.js +23 -25
- package/.output/server/node_modules/mongoose/lib/schema/date.js +19 -21
- package/.output/server/node_modules/mongoose/lib/schema/decimal128.js +16 -18
- package/.output/server/node_modules/mongoose/lib/schema/documentArray.js +94 -131
- package/.output/server/node_modules/mongoose/lib/schema/documentArrayElement.js +50 -16
- package/.output/server/node_modules/mongoose/lib/schema/double.js +16 -18
- package/.output/server/node_modules/mongoose/lib/schema/index.js +1 -0
- package/.output/server/node_modules/mongoose/lib/schema/int32.js +17 -19
- package/.output/server/node_modules/mongoose/lib/schema/map.js +17 -24
- package/.output/server/node_modules/mongoose/lib/schema/mixed.js +14 -14
- package/.output/server/node_modules/mongoose/lib/schema/number.js +38 -28
- package/.output/server/node_modules/mongoose/lib/schema/objectId.js +18 -20
- package/.output/server/node_modules/mongoose/lib/schema/operators/exists.js +1 -1
- package/.output/server/node_modules/mongoose/lib/schema/operators/geospatial.js +1 -1
- package/.output/server/node_modules/mongoose/lib/schema/operators/text.js +4 -4
- package/.output/server/node_modules/mongoose/lib/schema/string.js +42 -27
- package/.output/server/node_modules/mongoose/lib/schema/subdocument.js +47 -58
- package/.output/server/node_modules/mongoose/lib/schema/union.js +54 -4
- package/.output/server/node_modules/mongoose/lib/schema/uuid.js +17 -40
- package/.output/server/node_modules/mongoose/lib/schema.js +235 -176
- package/.output/server/node_modules/mongoose/lib/schemaType.js +227 -158
- package/.output/server/node_modules/mongoose/lib/stateMachine.js +5 -8
- package/.output/server/node_modules/mongoose/lib/types/array/index.js +5 -5
- package/.output/server/node_modules/mongoose/lib/types/array/methods/index.js +27 -28
- package/.output/server/node_modules/mongoose/lib/types/arraySubdocument.js +11 -11
- package/.output/server/node_modules/mongoose/lib/types/buffer.js +15 -15
- package/.output/server/node_modules/mongoose/lib/types/decimal128.js +1 -1
- package/.output/server/node_modules/mongoose/lib/types/documentArray/index.js +4 -4
- package/.output/server/node_modules/mongoose/lib/types/documentArray/methods/index.js +15 -13
- package/.output/server/node_modules/mongoose/lib/types/double.js +1 -1
- package/.output/server/node_modules/mongoose/lib/types/map.js +20 -71
- package/.output/server/node_modules/mongoose/lib/types/objectid.js +1 -1
- package/.output/server/node_modules/mongoose/lib/types/subdocument.js +32 -81
- package/.output/server/node_modules/mongoose/lib/types/uuid.js +1 -1
- package/.output/server/node_modules/mongoose/lib/utils.js +91 -70
- package/.output/server/node_modules/mongoose/lib/validOptions.js +4 -3
- package/.output/server/node_modules/mongoose/lib/virtualType.js +18 -18
- package/.output/server/node_modules/mongoose/package.json +46 -63
- package/.output/server/node_modules/mquery/lib/collection/collection.js +3 -1
- package/.output/server/node_modules/mquery/lib/collection/node.js +17 -3
- package/.output/server/node_modules/mquery/lib/mquery.js +136 -93
- package/.output/server/node_modules/mquery/lib/permissions.js +21 -6
- package/.output/server/node_modules/mquery/package.json +4 -7
- package/.output/server/package.json +7 -9
- package/package.json +3 -3
- package/.output/public/_nuxt/builds/meta/b59771ef-8e58-4078-9d18-ccc01cba96e9.json +0 -1
- package/.output/public/_nuxt/error-404.CTWLHxjC.css +0 -1
- package/.output/public/_nuxt/error-500.UBfk8-QP.css +0 -1
- package/.output/server/chunks/build/error-404-8tbBXju4.mjs.map +0 -1
- package/.output/server/chunks/build/error-404-styles.BeWfK6Py.mjs +0 -8
- package/.output/server/chunks/build/error-404-styles.BeWfK6Py.mjs.map +0 -1
- package/.output/server/chunks/build/error-500-DxFsom1i.mjs.map +0 -1
- package/.output/server/chunks/build/error-500-styles.CPUUvoY-.mjs +0 -8
- package/.output/server/chunks/build/error-500-styles.CPUUvoY-.mjs.map +0 -1
- package/.output/server/chunks/build/index-BB-Clavm.mjs.map +0 -1
- package/.output/server/node_modules/debug/package.json +0 -64
- package/.output/server/node_modules/debug/src/browser.js +0 -272
- package/.output/server/node_modules/debug/src/common.js +0 -292
- package/.output/server/node_modules/debug/src/index.js +0 -10
- package/.output/server/node_modules/debug/src/node.js +0 -263
- package/.output/server/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.js +0 -81
- package/.output/server/node_modules/mongodb/lib/resource_management.js +0 -58
- package/.output/server/node_modules/mongoose/lib/browserDocument.js +0 -101
- package/.output/server/node_modules/mongoose/lib/documentProvider.js +0 -30
- package/.output/server/node_modules/mongoose/lib/helpers/createJSONSchemaTypeDefinition.js +0 -24
- package/.output/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js +0 -54
- package/.output/server/node_modules/mongoose/lib/plugins/validateBeforeSave.js +0 -51
- package/.output/server/node_modules/supports-color/index.js +0 -202
- package/.output/server/node_modules/supports-color/package.json +0 -64
|
@@ -25,8 +25,7 @@ const StateMachine = module.exports = exports = function StateMachine() {
|
|
|
25
25
|
* methods named after each state. These transition methods
|
|
26
26
|
* place their path argument into the given state.
|
|
27
27
|
*
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {String} [state]
|
|
28
|
+
* @param {...string} state one or more state names
|
|
30
29
|
* @return {Function} subclass constructor
|
|
31
30
|
* @api private
|
|
32
31
|
*/
|
|
@@ -126,7 +125,7 @@ StateMachine.prototype.getStatePaths = function getStatePaths(state) {
|
|
|
126
125
|
* Checks to see if at least one path is in the states passed in via `arguments`
|
|
127
126
|
* e.g., this.some('required', 'inited')
|
|
128
127
|
*
|
|
129
|
-
* @param {
|
|
128
|
+
* @param {string} state that we want to check for.
|
|
130
129
|
* @api private
|
|
131
130
|
*/
|
|
132
131
|
|
|
@@ -145,7 +144,7 @@ StateMachine.prototype.some = function some() {
|
|
|
145
144
|
* This function builds the functions that get assigned to `forEach` and `map`,
|
|
146
145
|
* since both of those methods share a lot of the same logic.
|
|
147
146
|
*
|
|
148
|
-
* @param {
|
|
147
|
+
* @param {string} iterMethod is either 'forEach' or 'map'
|
|
149
148
|
* @return {Function}
|
|
150
149
|
* @api private
|
|
151
150
|
*/
|
|
@@ -180,8 +179,7 @@ StateMachine.prototype._iter = function _iter(iterMethod) {
|
|
|
180
179
|
* this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2
|
|
181
180
|
* this.forEach(fn); // iterates over all paths in all states
|
|
182
181
|
*
|
|
183
|
-
* @param {
|
|
184
|
-
* @param {String} [state]
|
|
182
|
+
* @param {...string} [state] one or more state names to filter by
|
|
185
183
|
* @param {Function} callback
|
|
186
184
|
* @api private
|
|
187
185
|
*/
|
|
@@ -199,8 +197,7 @@ StateMachine.prototype.forEach = function forEach() {
|
|
|
199
197
|
* this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2
|
|
200
198
|
* this.forEach(fn); // iterates over all paths in all states
|
|
201
199
|
*
|
|
202
|
-
* @param {
|
|
203
|
-
* @param {String} [state]
|
|
200
|
+
* @param {...string} [state] one or more state names to filter by
|
|
204
201
|
* @param {Function} callback
|
|
205
202
|
* @return {Array}
|
|
206
203
|
* @api private
|
|
@@ -20,7 +20,7 @@ const arraySchemaSymbol = require('../../helpers/symbols').arraySchemaSymbol;
|
|
|
20
20
|
* _Values always have to be passed to the constructor to initialize, otherwise `MongooseArray#push` will mark the array as modified._
|
|
21
21
|
*
|
|
22
22
|
* @param {Array} values
|
|
23
|
-
* @param {
|
|
23
|
+
* @param {string} path
|
|
24
24
|
* @param {Document} doc parent document
|
|
25
25
|
* @api private
|
|
26
26
|
* @inherits Array https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
@@ -72,7 +72,7 @@ function MongooseArray(values, path, doc, schematype) {
|
|
|
72
72
|
internals[arrayAtomicsSymbol] = values[arrayAtomicsSymbol];
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
if (doc
|
|
75
|
+
if (doc?.$__) {
|
|
76
76
|
internals[arrayParentSymbol] = doc;
|
|
77
77
|
internals[arraySchemaSymbol] = schematype || doc.schema.path(path);
|
|
78
78
|
}
|
|
@@ -85,11 +85,11 @@ function MongooseArray(values, path, doc, schematype) {
|
|
|
85
85
|
if (Object.hasOwn(mongooseArrayMethods, prop)) {
|
|
86
86
|
return mongooseArrayMethods[prop];
|
|
87
87
|
}
|
|
88
|
-
if (schematype
|
|
88
|
+
if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) {
|
|
89
89
|
return schematype.virtuals[prop].applyGetters(undefined, target);
|
|
90
90
|
}
|
|
91
|
-
if (typeof prop === 'string' && numberRE.test(prop) && schematype
|
|
92
|
-
return schematype
|
|
91
|
+
if (typeof prop === 'string' && numberRE.test(prop) && schematype?.embeddedSchemaType != null) {
|
|
92
|
+
return schematype.embeddedSchemaType.applyGetters(__array[prop], doc);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
return __array[prop];
|
|
@@ -60,9 +60,9 @@ const methods = {
|
|
|
60
60
|
val = val.toObject(opts);
|
|
61
61
|
} else if (Array.isArray(val)) {
|
|
62
62
|
val = this.toObject.call(val, opts);
|
|
63
|
-
} else if (
|
|
63
|
+
} else if (Array.isArray(val?.$each)) {
|
|
64
64
|
val.$each = this.toObject.call(val.$each, opts);
|
|
65
|
-
} else if (
|
|
65
|
+
} else if (typeof val?.valueOf === 'function') {
|
|
66
66
|
val = val.valueOf();
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -246,7 +246,7 @@ const methods = {
|
|
|
246
246
|
* Casts a member based on this arrays schema.
|
|
247
247
|
*
|
|
248
248
|
* @param {any} value
|
|
249
|
-
* @return
|
|
249
|
+
* @return {any} the casted value
|
|
250
250
|
* @method _cast
|
|
251
251
|
* @api private
|
|
252
252
|
* @memberOf MongooseArray
|
|
@@ -261,7 +261,7 @@ const methods = {
|
|
|
261
261
|
populated = parent.$populated(this[arrayPathSymbol], true);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
if (populated && value
|
|
264
|
+
if (populated && value != null) {
|
|
265
265
|
// cast to the populated Models schema
|
|
266
266
|
Model = populated.options[populateModelSymbol];
|
|
267
267
|
if (Model == null) {
|
|
@@ -277,22 +277,21 @@ const methods = {
|
|
|
277
277
|
|
|
278
278
|
// gh-2399
|
|
279
279
|
// we should cast model only when it's not a discriminator
|
|
280
|
-
const isDisc = value.schema
|
|
281
|
-
value.schema.discriminatorMapping.key !== undefined;
|
|
280
|
+
const isDisc = value.schema?.discriminatorMapping?.key !== undefined;
|
|
282
281
|
if (!isDisc) {
|
|
283
282
|
value = new Model(value);
|
|
284
283
|
}
|
|
285
|
-
return this[arraySchemaSymbol].
|
|
284
|
+
return this[arraySchemaSymbol].embeddedSchemaType.applySetters(value, parent, true);
|
|
286
285
|
}
|
|
287
286
|
|
|
288
|
-
return this[arraySchemaSymbol].
|
|
287
|
+
return this[arraySchemaSymbol].embeddedSchemaType.applySetters(value, parent, false);
|
|
289
288
|
},
|
|
290
289
|
|
|
291
290
|
/**
|
|
292
291
|
* Internal helper for .map()
|
|
293
292
|
*
|
|
294
293
|
* @api private
|
|
295
|
-
* @return {
|
|
294
|
+
* @return {number}
|
|
296
295
|
* @method _mapCast
|
|
297
296
|
* @memberOf MongooseArray
|
|
298
297
|
*/
|
|
@@ -307,7 +306,7 @@ const methods = {
|
|
|
307
306
|
* If it bubbles up from an embedded document change, then it takes the following arguments (otherwise, takes 0 arguments)
|
|
308
307
|
*
|
|
309
308
|
* @param {ArraySubdocument} subdoc the embedded doc that invoked this method on the Array
|
|
310
|
-
* @param {
|
|
309
|
+
* @param {string} embeddedPath the path which changed in the subdoc
|
|
311
310
|
* @method _markModified
|
|
312
311
|
* @api private
|
|
313
312
|
* @memberOf MongooseArray
|
|
@@ -369,7 +368,7 @@ const methods = {
|
|
|
369
368
|
|
|
370
369
|
// check for impossible $atomic combos (Mongo denies more than one
|
|
371
370
|
// $atomic op on a single path
|
|
372
|
-
if (atomics.$set ||
|
|
371
|
+
if (atomics.$set || utils.hasOwnKeys(atomics) && !(op in atomics)) {
|
|
373
372
|
// a different op was previously registered.
|
|
374
373
|
// save the entire thing.
|
|
375
374
|
this[arrayAtomicsSymbol] = { $set: this };
|
|
@@ -501,7 +500,7 @@ const methods = {
|
|
|
501
500
|
* Returns the number of pending atomic operations to send to the db for this array.
|
|
502
501
|
*
|
|
503
502
|
* @api private
|
|
504
|
-
* @return {
|
|
503
|
+
* @return {number}
|
|
505
504
|
* @method hasAtomics
|
|
506
505
|
* @memberOf MongooseArray
|
|
507
506
|
*/
|
|
@@ -517,9 +516,9 @@ const methods = {
|
|
|
517
516
|
/**
|
|
518
517
|
* Return whether or not the `obj` is included in the array.
|
|
519
518
|
*
|
|
520
|
-
* @param {
|
|
521
|
-
* @param {
|
|
522
|
-
* @return {
|
|
519
|
+
* @param {object} obj the item to check
|
|
520
|
+
* @param {number} fromIndex
|
|
521
|
+
* @return {boolean}
|
|
523
522
|
* @api public
|
|
524
523
|
* @method includes
|
|
525
524
|
* @memberOf MongooseArray
|
|
@@ -533,9 +532,9 @@ const methods = {
|
|
|
533
532
|
/**
|
|
534
533
|
* Return the index of `obj` or `-1` if not found.
|
|
535
534
|
*
|
|
536
|
-
* @param {
|
|
537
|
-
* @param {
|
|
538
|
-
* @return {
|
|
535
|
+
* @param {object} obj the item to look for
|
|
536
|
+
* @param {number} fromIndex
|
|
537
|
+
* @return {number}
|
|
539
538
|
* @api public
|
|
540
539
|
* @method indexOf
|
|
541
540
|
* @memberOf MongooseArray
|
|
@@ -573,7 +572,7 @@ const methods = {
|
|
|
573
572
|
*
|
|
574
573
|
* #### Note:
|
|
575
574
|
*
|
|
576
|
-
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially
|
|
575
|
+
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._
|
|
577
576
|
*
|
|
578
577
|
* @param {...any} [args]
|
|
579
578
|
* @api public
|
|
@@ -708,7 +707,7 @@ const methods = {
|
|
|
708
707
|
* });
|
|
709
708
|
* doc.nums; // [1, 2, 3, 4, 5]
|
|
710
709
|
*
|
|
711
|
-
* @param {...
|
|
710
|
+
* @param {...object} [args]
|
|
712
711
|
* @api public
|
|
713
712
|
* @method push
|
|
714
713
|
* @memberOf MongooseArray
|
|
@@ -831,7 +830,7 @@ const methods = {
|
|
|
831
830
|
*
|
|
832
831
|
* #### Note:
|
|
833
832
|
*
|
|
834
|
-
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially
|
|
833
|
+
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._
|
|
835
834
|
*
|
|
836
835
|
* @api public
|
|
837
836
|
* @method shift
|
|
@@ -851,7 +850,7 @@ const methods = {
|
|
|
851
850
|
*
|
|
852
851
|
* #### Note:
|
|
853
852
|
*
|
|
854
|
-
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially
|
|
853
|
+
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._
|
|
855
854
|
*
|
|
856
855
|
* @api public
|
|
857
856
|
* @method sort
|
|
@@ -871,7 +870,7 @@ const methods = {
|
|
|
871
870
|
*
|
|
872
871
|
* #### Note:
|
|
873
872
|
*
|
|
874
|
-
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially
|
|
873
|
+
* _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._
|
|
875
874
|
*
|
|
876
875
|
* @api public
|
|
877
876
|
* @method splice
|
|
@@ -917,7 +916,7 @@ const methods = {
|
|
|
917
916
|
/**
|
|
918
917
|
* Returns a native js Array.
|
|
919
918
|
*
|
|
920
|
-
* @param {
|
|
919
|
+
* @param {object} options
|
|
921
920
|
* @return {Array}
|
|
922
921
|
* @api public
|
|
923
922
|
* @method toObject
|
|
@@ -926,7 +925,7 @@ const methods = {
|
|
|
926
925
|
|
|
927
926
|
toObject(options) {
|
|
928
927
|
const arr = utils.isMongooseArray(this) ? this.__array : this;
|
|
929
|
-
if (options
|
|
928
|
+
if (options?.depopulate) {
|
|
930
929
|
options = clone(options);
|
|
931
930
|
options._isNested = true;
|
|
932
931
|
// Ensure return value is a vanilla array, because in Node.js 6+ `map()`
|
|
@@ -1026,7 +1025,7 @@ function _minimizePath(obj, parts, i) {
|
|
|
1026
1025
|
}
|
|
1027
1026
|
|
|
1028
1027
|
_minimizePath(obj[parts[0]], parts, i + 1);
|
|
1029
|
-
if (obj[parts[0]] != null && typeof obj[parts[0]] === 'object' &&
|
|
1028
|
+
if (obj[parts[0]] != null && typeof obj[parts[0]] === 'object' && utils.hasOwnKeys(obj[parts[0]]) === false) {
|
|
1030
1029
|
delete obj[parts[0]];
|
|
1031
1030
|
}
|
|
1032
1031
|
}
|
|
@@ -1038,7 +1037,7 @@ function _minimizePath(obj, parts, i) {
|
|
|
1038
1037
|
function _checkManualPopulation(arr, docs) {
|
|
1039
1038
|
const ref = arr == null ?
|
|
1040
1039
|
null :
|
|
1041
|
-
arr[arraySchemaSymbol]
|
|
1040
|
+
arr[arraySchemaSymbol]?.embeddedSchemaType?.options?.ref || null;
|
|
1042
1041
|
if (arr.length === 0 &&
|
|
1043
1042
|
docs.length !== 0) {
|
|
1044
1043
|
if (_isAllSubdocs(docs, ref)) {
|
|
@@ -1056,7 +1055,7 @@ function _checkManualPopulation(arr, docs) {
|
|
|
1056
1055
|
function _depopulateIfNecessary(arr, docs) {
|
|
1057
1056
|
const ref = arr == null ?
|
|
1058
1057
|
null :
|
|
1059
|
-
arr[arraySchemaSymbol]
|
|
1058
|
+
arr[arraySchemaSymbol]?.embeddedSchemaType?.options?.ref || null;
|
|
1060
1059
|
const parentDoc = arr[arrayParentSymbol];
|
|
1061
1060
|
const path = arr[arrayPathSymbol];
|
|
1062
1061
|
if (!ref || !parentDoc.populated(path)) {
|
|
@@ -13,11 +13,11 @@ const documentArrayParent = require('../helpers/symbols').documentArrayParent;
|
|
|
13
13
|
/**
|
|
14
14
|
* A constructor.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {object} obj js object returned from the db
|
|
17
17
|
* @param {MongooseDocumentArray} parentArr the parent array of this document
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {
|
|
20
|
-
* @param {
|
|
18
|
+
* @param {boolean} skipId
|
|
19
|
+
* @param {object} fields
|
|
20
|
+
* @param {number} index
|
|
21
21
|
* @inherits Document
|
|
22
22
|
* @api private
|
|
23
23
|
*/
|
|
@@ -41,7 +41,7 @@ function ArraySubdocument(obj, parentArr, skipId, fields, index) {
|
|
|
41
41
|
options = { isNew: true };
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
Subdocument.call(this, obj, fields, this[documentArrayParent],
|
|
44
|
+
Subdocument.call(this, obj, fields, this[documentArrayParent], options);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/*!
|
|
@@ -73,7 +73,7 @@ for (const i in EventEmitter.prototype) {
|
|
|
73
73
|
ArraySubdocument.prototype.$setIndex = function(index) {
|
|
74
74
|
this.__index = index;
|
|
75
75
|
|
|
76
|
-
if (this.$__
|
|
76
|
+
if (this.$__?.validationError != null) {
|
|
77
77
|
const keys = Object.keys(this.$__.validationError.errors);
|
|
78
78
|
for (const key of keys) {
|
|
79
79
|
this.invalidate(key, this.$__.validationError.errors[key]);
|
|
@@ -107,9 +107,9 @@ ArraySubdocument.prototype.$__removeFromParent = function() {
|
|
|
107
107
|
/**
|
|
108
108
|
* Returns the full path to this document. If optional `path` is passed, it is appended to the full path.
|
|
109
109
|
*
|
|
110
|
-
* @param {
|
|
111
|
-
* @param {
|
|
112
|
-
* @return {
|
|
110
|
+
* @param {string} [path]
|
|
111
|
+
* @param {boolean} [skipIndex] Skip adding the array index. For example `arr.foo` instead of `arr.0.foo`.
|
|
112
|
+
* @return {string}
|
|
113
113
|
* @api private
|
|
114
114
|
* @method $__fullPath
|
|
115
115
|
* @memberOf ArraySubdocument
|
|
@@ -145,7 +145,7 @@ ArraySubdocument.prototype.$__fullPath = function(path, skipIndex) {
|
|
|
145
145
|
*/
|
|
146
146
|
|
|
147
147
|
ArraySubdocument.prototype.$__pathRelativeToParent = function(path, skipIndex) {
|
|
148
|
-
if (this.__index == null ||
|
|
148
|
+
if (this.__index == null || !this.__parentArray?.$path) {
|
|
149
149
|
return null;
|
|
150
150
|
}
|
|
151
151
|
if (skipIndex) {
|
|
@@ -194,7 +194,7 @@ ArraySubdocument.prototype.$__setParent = function $__setParent(parent) {
|
|
|
194
194
|
*
|
|
195
195
|
* @api public
|
|
196
196
|
* @method parentArray
|
|
197
|
-
* @returns DocumentArray
|
|
197
|
+
* @returns {DocumentArray}
|
|
198
198
|
*/
|
|
199
199
|
|
|
200
200
|
ArraySubdocument.prototype.parentArray = function() {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
|
-
const Binary = require('bson').Binary;
|
|
8
|
-
const UUID = require('bson').UUID;
|
|
7
|
+
const Binary = require('mongodb/lib/bson').Binary;
|
|
8
|
+
const UUID = require('mongodb/lib/bson').UUID;
|
|
9
9
|
const utils = require('../utils');
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -14,8 +14,8 @@ const utils = require('../utils');
|
|
|
14
14
|
* Values always have to be passed to the constructor to initialize.
|
|
15
15
|
*
|
|
16
16
|
* @param {Buffer} value
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
17
|
+
* @param {string} encode
|
|
18
|
+
* @param {number} offset
|
|
19
19
|
* @api private
|
|
20
20
|
* @inherits Buffer https://nodejs.org/api/buffer.html
|
|
21
21
|
* @see https://bit.ly/f6CnZU
|
|
@@ -121,7 +121,7 @@ MongooseBuffer.mixin = {
|
|
|
121
121
|
*
|
|
122
122
|
* `Buffer#copy` does not mark `target` as modified so you must copy from a `MongooseBuffer` for it to work as expected. This is a work around since `copy` modifies the target, not this.
|
|
123
123
|
*
|
|
124
|
-
* @return {
|
|
124
|
+
* @return {number} The number of bytes copied.
|
|
125
125
|
* @param {Buffer} target
|
|
126
126
|
* @method copy
|
|
127
127
|
* @memberOf MongooseBuffer.mixin
|
|
@@ -131,7 +131,7 @@ MongooseBuffer.mixin = {
|
|
|
131
131
|
copy: function(target) {
|
|
132
132
|
const ret = Buffer.prototype.copy.apply(this, arguments);
|
|
133
133
|
|
|
134
|
-
if (target
|
|
134
|
+
if (target?.isMongooseBuffer) {
|
|
135
135
|
target._markModified();
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -169,14 +169,14 @@ utils.each(
|
|
|
169
169
|
*
|
|
170
170
|
* #### SubTypes:
|
|
171
171
|
*
|
|
172
|
-
* const
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
* doc.buffer.toObject(
|
|
172
|
+
* const mongodb = require('mongodb')
|
|
173
|
+
* mongodb.BSON.BSON_BINARY_SUBTYPE_DEFAULT
|
|
174
|
+
* mongodb.BSON.BSON_BINARY_SUBTYPE_FUNCTION
|
|
175
|
+
* mongodb.BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY
|
|
176
|
+
* mongodb.BSON.BSON_BINARY_SUBTYPE_UUID
|
|
177
|
+
* mongodb.BSON.BSON_BINARY_SUBTYPE_MD5
|
|
178
|
+
* mongodb.BSON.BSON_BINARY_SUBTYPE_USER_DEFINED
|
|
179
|
+
* doc.buffer.toObject(mongodb.BSON.BSON_BINARY_SUBTYPE_USER_DEFINED);
|
|
180
180
|
*
|
|
181
181
|
* @see bsonspec https://bsonspec.org/#/specification
|
|
182
182
|
* @param {Hex} [subtype]
|
|
@@ -228,7 +228,7 @@ MongooseBuffer.mixin.toUUID = function() {
|
|
|
228
228
|
* Determines if this buffer is equals to `other` buffer
|
|
229
229
|
*
|
|
230
230
|
* @param {Buffer} other
|
|
231
|
-
* @return {
|
|
231
|
+
* @return {boolean}
|
|
232
232
|
* @method equals
|
|
233
233
|
* @memberOf MongooseBuffer
|
|
234
234
|
*/
|
|
@@ -19,7 +19,7 @@ const numberRE = /^\d+$/;
|
|
|
19
19
|
* DocumentArray constructor
|
|
20
20
|
*
|
|
21
21
|
* @param {Array} values
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {string} path the path to this array
|
|
23
23
|
* @param {Document} doc parent document
|
|
24
24
|
* @api private
|
|
25
25
|
* @return {MongooseDocumentArray}
|
|
@@ -50,7 +50,7 @@ function MongooseDocumentArray(values, path, doc, schematype) {
|
|
|
50
50
|
internals[arrayPathSymbol] = path;
|
|
51
51
|
internals.__array = __array;
|
|
52
52
|
|
|
53
|
-
if (doc
|
|
53
|
+
if (doc?.$__) {
|
|
54
54
|
internals[arrayParentSymbol] = doc;
|
|
55
55
|
internals[arraySchemaSymbol] = doc.$__schema.path(path);
|
|
56
56
|
|
|
@@ -61,7 +61,7 @@ function MongooseDocumentArray(values, path, doc, schematype) {
|
|
|
61
61
|
while (internals[arraySchemaSymbol] != null &&
|
|
62
62
|
internals[arraySchemaSymbol].$isMongooseArray &&
|
|
63
63
|
!internals[arraySchemaSymbol].$isMongooseDocumentArray) {
|
|
64
|
-
internals[arraySchemaSymbol] = internals[arraySchemaSymbol].
|
|
64
|
+
internals[arraySchemaSymbol] = internals[arraySchemaSymbol].embeddedSchemaType;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -79,7 +79,7 @@ function MongooseDocumentArray(values, path, doc, schematype) {
|
|
|
79
79
|
if (Object.hasOwn(DocumentArrayMethods, prop)) {
|
|
80
80
|
return DocumentArrayMethods[prop];
|
|
81
81
|
}
|
|
82
|
-
if (schematype
|
|
82
|
+
if (schematype?.virtuals && Object.hasOwn(schematype.virtuals, prop)) {
|
|
83
83
|
return schematype.virtuals[prop].applyGetters(undefined, target);
|
|
84
84
|
}
|
|
85
85
|
if (Object.hasOwn(ArrayMethods, prop)) {
|
|
@@ -25,7 +25,7 @@ const methods = {
|
|
|
25
25
|
|
|
26
26
|
toString() {
|
|
27
27
|
return _baseToString.call(this.__array.map(subdoc => {
|
|
28
|
-
if (subdoc
|
|
28
|
+
if (subdoc?.$__ != null) {
|
|
29
29
|
return subdoc.toString();
|
|
30
30
|
}
|
|
31
31
|
return subdoc;
|
|
@@ -59,13 +59,13 @@ const methods = {
|
|
|
59
59
|
if (this[arraySchemaSymbol] == null) {
|
|
60
60
|
return value;
|
|
61
61
|
}
|
|
62
|
-
let Constructor = this[arraySchemaSymbol].
|
|
62
|
+
let Constructor = this[arraySchemaSymbol].Constructor;
|
|
63
63
|
const isInstance = Constructor.$isMongooseDocumentArray ?
|
|
64
64
|
utils.isMongooseDocumentArray(value) :
|
|
65
65
|
value instanceof Constructor;
|
|
66
66
|
if (isInstance ||
|
|
67
67
|
// Hack re: #5001, see #5005
|
|
68
|
-
|
|
68
|
+
value?.constructor?.baseCasterConstructor === Constructor) {
|
|
69
69
|
if (!(value[documentArrayParent] && value.__parentArray)) {
|
|
70
70
|
// value may have been created using array.create()
|
|
71
71
|
value[documentArrayParent] = this[arrayParentSymbol];
|
|
@@ -75,7 +75,7 @@ const methods = {
|
|
|
75
75
|
return value;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
if (value
|
|
78
|
+
if (value == null) {
|
|
79
79
|
return null;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -119,7 +119,7 @@ const methods = {
|
|
|
119
119
|
* const embeddedDoc = m.array.id(some_id);
|
|
120
120
|
*
|
|
121
121
|
* @return {EmbeddedDocument|null} the subdocument or null if not found.
|
|
122
|
-
* @param {ObjectId|
|
|
122
|
+
* @param {ObjectId|string|number|Buffer} id
|
|
123
123
|
* @method id
|
|
124
124
|
* @api public
|
|
125
125
|
* @memberOf MongooseDocumentArray
|
|
@@ -133,9 +133,9 @@ const methods = {
|
|
|
133
133
|
const schemaType = this[arraySchemaSymbol];
|
|
134
134
|
let idSchemaType = null;
|
|
135
135
|
|
|
136
|
-
if (schemaType
|
|
136
|
+
if (schemaType?.schema) {
|
|
137
137
|
idSchemaType = schemaType.schema.path('_id');
|
|
138
|
-
} else if (schemaType
|
|
138
|
+
} else if (schemaType?.casterConstructor?.schema) {
|
|
139
139
|
idSchemaType = schemaType.casterConstructor.schema.path('_id');
|
|
140
140
|
}
|
|
141
141
|
|
|
@@ -143,7 +143,9 @@ const methods = {
|
|
|
143
143
|
if (idSchemaType) {
|
|
144
144
|
try {
|
|
145
145
|
castedId = idSchemaType.cast(id);
|
|
146
|
-
} catch
|
|
146
|
+
} catch {
|
|
147
|
+
// ignore error
|
|
148
|
+
}
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
let _id;
|
|
@@ -183,7 +185,7 @@ const methods = {
|
|
|
183
185
|
*
|
|
184
186
|
* _Each sub-document is converted to a plain object by calling its `#toObject` method._
|
|
185
187
|
*
|
|
186
|
-
* @param {
|
|
188
|
+
* @param {object} [options] optional options to pass to each documents `toObject` method call during conversion
|
|
187
189
|
* @return {Array}
|
|
188
190
|
* @method toObject
|
|
189
191
|
* @api public
|
|
@@ -211,7 +213,7 @@ const methods = {
|
|
|
211
213
|
/**
|
|
212
214
|
* Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking.
|
|
213
215
|
*
|
|
214
|
-
* @param {...
|
|
216
|
+
* @param {...object} [args]
|
|
215
217
|
* @api public
|
|
216
218
|
* @method push
|
|
217
219
|
* @memberOf MongooseDocumentArray
|
|
@@ -228,7 +230,7 @@ const methods = {
|
|
|
228
230
|
/**
|
|
229
231
|
* Pulls items from the array atomically.
|
|
230
232
|
*
|
|
231
|
-
* @param {...
|
|
233
|
+
* @param {...object} [args]
|
|
232
234
|
* @api public
|
|
233
235
|
* @method pull
|
|
234
236
|
* @memberOf MongooseDocumentArray
|
|
@@ -285,14 +287,14 @@ const methods = {
|
|
|
285
287
|
*
|
|
286
288
|
* This is the same subdocument constructor used for casting.
|
|
287
289
|
*
|
|
288
|
-
* @param {
|
|
290
|
+
* @param {object} obj the value to cast to this arrays SubDocument schema
|
|
289
291
|
* @method create
|
|
290
292
|
* @api public
|
|
291
293
|
* @memberOf MongooseDocumentArray
|
|
292
294
|
*/
|
|
293
295
|
|
|
294
296
|
create(obj) {
|
|
295
|
-
let Constructor = this[arraySchemaSymbol].
|
|
297
|
+
let Constructor = this[arraySchemaSymbol].Constructor;
|
|
296
298
|
if (obj &&
|
|
297
299
|
Constructor.discriminators &&
|
|
298
300
|
Constructor.schema &&
|