@prisma/orm-family-mongo 8.0.0-rc.2-dev.3 → 8.0.0-rc.20-dev.1
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/README.md +1 -5
- package/dist/authoring-entity-types-UA5sY_Xm-DeYf_cYq.mjs +87 -0
- package/dist/authoring-entity-types-UA5sY_Xm-DeYf_cYq.mjs.map +1 -0
- package/dist/{canonicalization-hooks-DF3Z6sjO.mjs → canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs} +4 -3
- package/dist/canonicalization-hooks-CRVM-Kqh-Qi-VmEVg.mjs.map +1 -0
- package/dist/codec.d.mts +1 -1
- package/dist/codec.mjs +1 -1
- package/dist/{config-types-CFDf9ivE.mjs → config-types-DYTCUpAs.mjs} +5 -5
- package/dist/config-types-DYTCUpAs.mjs.map +1 -0
- package/dist/contract-builder-BHzQQk70.mjs +965 -0
- package/dist/contract-builder-BHzQQk70.mjs.map +1 -0
- package/dist/{contract-builder-DB8nguDE.d.mts → contract-builder-ClL-xMK2.d.mts} +271 -89
- package/dist/contract-builder-ClL-xMK2.d.mts.map +1 -0
- package/dist/contract-prisma6__provider.d.mts +35 -0
- package/dist/contract-prisma6__provider.d.mts.map +1 -0
- package/dist/contract-prisma6__provider.mjs +1202 -0
- package/dist/contract-prisma6__provider.mjs.map +1 -0
- package/dist/contract-psl.d.mts +152 -28
- package/dist/contract-psl.d.mts.map +1 -1
- package/dist/contract-psl.mjs +3 -2
- package/dist/contract-psl__provider.mjs +74 -44
- package/dist/contract-psl__provider.mjs.map +1 -1
- package/dist/contract-ts.d.mts +2 -2
- package/dist/contract-ts.mjs +2 -2
- package/dist/contract-ts__config-types.mjs +1 -1
- package/dist/contract-ts__contract-builder.d.mts +2 -2
- package/dist/contract-ts__contract-builder.mjs +1 -1
- package/dist/contract.d.mts +3 -3
- package/dist/contract.mjs +3 -3
- package/dist/contract__canonicalization-hooks.mjs +1 -1
- package/dist/contract__data-type.d.mts +37 -0
- package/dist/contract__data-type.d.mts.map +1 -0
- package/dist/contract__data-type.mjs +2 -0
- package/dist/contract__entity-kinds.d.mts +1 -1
- package/dist/contract__entity-kinds.mjs +1 -1
- package/dist/{control-C7-kthr1.d.mts → control-4pC8N2Rb.d.mts} +32 -19
- package/dist/control-4pC8N2Rb.d.mts.map +1 -0
- package/dist/{control-CClR5JMr.mjs → control-BQMBG11d.mjs} +19 -2
- package/dist/control-BQMBG11d.mjs.map +1 -0
- package/dist/{control-BbZQqmxo.mjs → control-B_pPN58L.mjs} +195 -87
- package/dist/control-B_pPN58L.mjs.map +1 -0
- package/dist/{control-Cj81sPbj.d.mts → control-CvQSMuxa.d.mts} +29 -6
- package/dist/control-CvQSMuxa.d.mts.map +1 -0
- package/dist/{control-adapter-Db5pT77b.d.mts → control-adapter-Bh_ZraGM--5JDb99k.d.mts} +48 -4
- package/dist/control-adapter-Bh_ZraGM--5JDb99k.d.mts.map +1 -0
- package/dist/control-adapter-CndDiTXW.d.mts +1 -0
- package/dist/dist-B8f-pfcT.mjs +1031 -0
- package/dist/dist-B8f-pfcT.mjs.map +1 -0
- package/dist/dist-Bgk36iLI.mjs +53 -0
- package/dist/dist-Bgk36iLI.mjs.map +1 -0
- package/dist/{dist-C7Ykq48Q.mjs → dist-CO2arS1K.mjs} +3 -1
- package/dist/dist-CO2arS1K.mjs.map +1 -0
- package/dist/{dist-Dyp05u64.mjs → dist-gmGbjhmk.mjs} +56 -32
- package/dist/dist-gmGbjhmk.mjs.map +1 -0
- package/dist/dist-xk_0xOR-.mjs +28 -0
- package/dist/dist-xk_0xOR-.mjs.map +1 -0
- package/dist/emitter.d.mts +2 -4
- package/dist/emitter.d.mts.map +1 -1
- package/dist/emitter.mjs +1 -1
- package/dist/{entity-kinds-B4KNTF8z-DPIuUuuB.mjs → entity-kinds-BQBtfVet-B-Px7NHp.mjs} +35 -18
- package/dist/entity-kinds-BQBtfVet-B-Px7NHp.mjs.map +1 -0
- package/dist/{execution-D5XyZ5XS.mjs → execution-CgP1Sdbr.mjs} +6 -3
- package/dist/execution-CgP1Sdbr.mjs.map +1 -0
- package/dist/{execution-CKnUiOfm.d.mts → execution-tPmN5pge.d.mts} +6 -2
- package/dist/execution-tPmN5pge.d.mts.map +1 -0
- package/dist/{exports-Bx-hlnZ3.mjs → exports-BAimNKOs.mjs} +31 -21
- package/dist/exports-BAimNKOs.mjs.map +1 -0
- package/dist/exports-BHQVApAg.mjs +86 -0
- package/dist/exports-BHQVApAg.mjs.map +1 -0
- package/dist/family.d.mts +11 -10
- package/dist/family.mjs +10 -9
- package/dist/family__control-adapter.d.mts +3 -2
- package/dist/family__control.d.mts +2 -2
- package/dist/family__control.mjs +3 -3
- package/dist/family__ir.d.mts +2 -2
- package/dist/family__ir.mjs +3 -3
- package/dist/family__migration.d.mts +1 -1
- package/dist/family__migration.mjs +1 -1
- package/dist/family__pack.d.mts +1 -1
- package/dist/family__pack.mjs +4 -2
- package/dist/family__pack.mjs.map +1 -1
- package/dist/family__runtime.d.mts +3 -3
- package/dist/family__runtime.mjs +3 -2
- package/dist/family__schema-verify.d.mts +1 -1
- package/dist/family__schema-verify.mjs +1 -1
- package/dist/{field-accessor-0oUt6RZC-B_Z30uAA.mjs → field-accessor-0oUt6RZC-CrJVzQiS.mjs} +2 -2
- package/dist/{field-accessor-0oUt6RZC-B_Z30uAA.mjs.map → field-accessor-0oUt6RZC-CrJVzQiS.mjs.map} +1 -1
- package/dist/{field-accessor-DHsAPiW3-BdYCspQC.d.mts → field-accessor-CmxCw9xP-C6jMngbK.d.mts} +35 -24
- package/dist/field-accessor-CmxCw9xP-C6jMngbK.d.mts.map +1 -0
- package/dist/index-9DDQlC5U.d.mts +87 -0
- package/dist/index-9DDQlC5U.d.mts.map +1 -0
- package/dist/{index-BR0ue13b.d.mts → index-BdXzdXGE.d.mts} +14 -8
- package/dist/index-BdXzdXGE.d.mts.map +1 -0
- package/dist/index-BhIiYIXu.d.mts +845 -0
- package/dist/index-BhIiYIXu.d.mts.map +1 -0
- package/dist/index-CQG5l2o9.d.mts +67 -0
- package/dist/index-CQG5l2o9.d.mts.map +1 -0
- package/dist/{index-DAOkcTCK.d.mts → index-FeVOOdZ0.d.mts} +9 -8
- package/dist/index-FeVOOdZ0.d.mts.map +1 -0
- package/dist/index-YY1SU_7o.d.mts +366 -0
- package/dist/index-YY1SU_7o.d.mts.map +1 -0
- package/dist/{index-DxoO-ywI.d.mts → index-rANtsIZG.d.mts} +9 -5
- package/dist/{index-DxoO-ywI.d.mts.map → index-rANtsIZG.d.mts.map} +1 -1
- package/dist/interpreter-BfHdPd7T-DGqi2_Um.mjs +2186 -0
- package/dist/interpreter-BfHdPd7T-DGqi2_Um.mjs.map +1 -0
- package/dist/{ir-CQrenTYt.d.mts → ir-BLC0t6_x.d.mts} +5 -27
- package/dist/ir-BLC0t6_x.d.mts.map +1 -0
- package/dist/{ir-Ch2aPr7a.mjs → ir-DGm0HXbP.mjs} +3 -8
- package/dist/ir-DGm0HXbP.mjs.map +1 -0
- package/dist/lowering.d.mts +1 -1
- package/dist/{migration-dcM7u4HG.mjs → migration-DnQ7_A_B.mjs} +4 -4
- package/dist/migration-DnQ7_A_B.mjs.map +1 -0
- package/dist/{migration-CNDQv5yB.d.mts → migration-YQVmgFU8.d.mts} +7 -7
- package/dist/{migration-CNDQv5yB.d.mts.map → migration-YQVmgFU8.d.mts.map} +1 -1
- package/dist/{mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs → mongo-contract-serializer-Zx1rvil3-BywiKCpn.mjs} +27 -8
- package/dist/mongo-contract-serializer-Zx1rvil3-BywiKCpn.mjs.map +1 -0
- package/dist/{mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts → mongo-contract-view-AnejqfrQ-Wj_ulq2L.d.mts} +3 -3
- package/dist/{mongo-contract-view-AnejqfrQ-BaCFT0xm.d.mts.map → mongo-contract-view-AnejqfrQ-Wj_ulq2L.d.mts.map} +1 -1
- package/dist/{mongo-contract-view-rcWzby6f-wRBCUnBt.mjs → mongo-contract-view-D5yu2LrY-DCAZYJ4q.mjs} +4 -4
- package/dist/{mongo-contract-view-rcWzby6f-wRBCUnBt.mjs.map → mongo-contract-view-D5yu2LrY-DCAZYJ4q.mjs.map} +1 -1
- package/dist/mongo-data-type-DzyzU4LF-C1ydFXgE.mjs +53 -0
- package/dist/mongo-data-type-DzyzU4LF-C1ydFXgE.mjs.map +1 -0
- package/dist/{mongo-value-set-tNn9-pun-dJYx_rVD.d.mts → mongo-value-set-DEd7WLCT-B2Ar2GkJ.d.mts} +20 -4
- package/dist/mongo-value-set-DEd7WLCT-B2Ar2GkJ.d.mts.map +1 -0
- package/dist/orm.d.mts +154 -96
- package/dist/orm.d.mts.map +1 -1
- package/dist/orm.mjs +670 -148
- package/dist/orm.mjs.map +1 -1
- package/dist/pack-qw77Jt2G.d.mts +58 -0
- package/dist/pack-qw77Jt2G.d.mts.map +1 -0
- package/dist/query-ast.d.mts +5 -5
- package/dist/query-ast.mjs +3 -3
- package/dist/query-ast__control.d.mts +4 -4
- package/dist/query-ast__control.mjs +2 -2
- package/dist/query-ast__execution.d.mts +2 -2
- package/dist/query-ast__execution.mjs +1 -1
- package/dist/query-builder.d.mts +4 -836
- package/dist/query-builder.mjs +2 -2
- package/dist/query-builder__contract-free.d.mts +6 -6
- package/dist/query-builder__contract-free.mjs +3 -3
- package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts → query-plan-3fs1HokF-CrNsr-Wx.d.mts} +10 -4
- package/dist/{query-plan-C0-Yu8hf-DdilEdW6.d.mts.map → query-plan-3fs1HokF-CrNsr-Wx.d.mts.map} +1 -1
- package/dist/runtime-B5fNQHQZ.mjs +16 -0
- package/dist/runtime-B5fNQHQZ.mjs.map +1 -0
- package/dist/runtime-yZA30qM2.d.mts +11 -0
- package/dist/runtime-yZA30qM2.d.mts.map +1 -0
- package/dist/runtime.d.mts +74 -87
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +133 -67
- package/dist/runtime.mjs.map +1 -1
- package/dist/schema-ir.d.mts +2 -2
- package/dist/schema-ir.mjs +2 -2
- package/dist/{schema-verify-DJGr28XW.d.mts → schema-verify-CVOG6EZx.d.mts} +5 -5
- package/dist/{schema-verify-DJGr28XW.d.mts.map → schema-verify-CVOG6EZx.d.mts.map} +1 -1
- package/dist/value.d.mts +2 -2
- package/dist/value.mjs +1 -1
- package/dist/{verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs → verify-mongo-schema-CeQP5N4k-CNOctppM.mjs} +9 -26
- package/dist/verify-mongo-schema-CeQP5N4k-CNOctppM.mjs.map +1 -0
- package/dist/wire.d.mts +3 -3
- package/dist/wire.mjs +14 -2
- package/dist/wire.mjs.map +1 -1
- package/package.json +24 -21
- package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs +0 -176
- package/dist/authoring-entity-types-BGtkMyoN-D32kzx28.mjs.map +0 -1
- package/dist/canonicalization-hooks-DF3Z6sjO.mjs.map +0 -1
- package/dist/config-types-CFDf9ivE.mjs.map +0 -1
- package/dist/contract-builder-BFq0gOMV.mjs +0 -634
- package/dist/contract-builder-BFq0gOMV.mjs.map +0 -1
- package/dist/contract-builder-DB8nguDE.d.mts.map +0 -1
- package/dist/control-BbZQqmxo.mjs.map +0 -1
- package/dist/control-C7-kthr1.d.mts.map +0 -1
- package/dist/control-CClR5JMr.mjs.map +0 -1
- package/dist/control-Cj81sPbj.d.mts.map +0 -1
- package/dist/control-adapter-Db5pT77b.d.mts.map +0 -1
- package/dist/dist-C7Ykq48Q.mjs.map +0 -1
- package/dist/dist-Czwqx_i3.mjs +0 -58
- package/dist/dist-Czwqx_i3.mjs.map +0 -1
- package/dist/dist-DHrEJnhK.mjs +0 -236
- package/dist/dist-DHrEJnhK.mjs.map +0 -1
- package/dist/dist-Dyp05u64.mjs.map +0 -1
- package/dist/entity-kinds-B4KNTF8z-DPIuUuuB.mjs.map +0 -1
- package/dist/execution-CKnUiOfm.d.mts.map +0 -1
- package/dist/execution-D5XyZ5XS.mjs.map +0 -1
- package/dist/exports-Bx-hlnZ3.mjs.map +0 -1
- package/dist/exports-C4RGBGzZ.mjs +0 -156
- package/dist/exports-C4RGBGzZ.mjs.map +0 -1
- package/dist/field-accessor-DHsAPiW3-BdYCspQC.d.mts.map +0 -1
- package/dist/index-BR0ue13b.d.mts.map +0 -1
- package/dist/index-Cd2zLiU6.d.mts +0 -128
- package/dist/index-Cd2zLiU6.d.mts.map +0 -1
- package/dist/index-DAOkcTCK.d.mts.map +0 -1
- package/dist/index-Dv2PNMiG.d.mts +0 -53
- package/dist/index-Dv2PNMiG.d.mts.map +0 -1
- package/dist/index-wKMm41HC.d.mts +0 -30
- package/dist/index-wKMm41HC.d.mts.map +0 -1
- package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs +0 -1091
- package/dist/interpreter-BxbUTQ3k-ClR98Ned.mjs.map +0 -1
- package/dist/ir-CQrenTYt.d.mts.map +0 -1
- package/dist/ir-Ch2aPr7a.mjs.map +0 -1
- package/dist/migration-dcM7u4HG.mjs.map +0 -1
- package/dist/mongo-contract-serializer-Cx7Fae8e-C8ZYPXpc.mjs.map +0 -1
- package/dist/mongo-value-set-tNn9-pun-dJYx_rVD.d.mts.map +0 -1
- package/dist/pack-D9aLY50F.d.mts +0 -44
- package/dist/pack-D9aLY50F.d.mts.map +0 -1
- package/dist/query-builder.d.mts.map +0 -1
- package/dist/runtime-DPkRW4iu.d.mts +0 -1
- package/dist/verify-mongo-schema-De0FG2Rm-CCzwnNPY.mjs.map +0 -1
package/dist/orm.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orm.mjs","names":["#contract","#modelName","#executor","#collectionName","#state","#cloneWithVariant","#clone","#compileWhereObject","#query","#rejectIncludes","#injectDiscriminator","#stripUndefined","#toDocument","#drainPlan","#insertOneResultShape","#insertManyResultShape","#requireFilters","#rejectWindowing","#mergeFilters","#resolveUpdateDoc","#modelResultShape","#readMatchingIds","#executePlan","#wrapFieldOpValue","#toSetFields","#compile","#planMeta","#wrapCommand","#modelFields","#idFieldShape","#wrapFieldValue","#wrapValueObject","#toUpdateDocument","#wrapDotPathValue","#variantName"],"sources":["../../../../2-mongo-family/5-query-builders/orm/dist/index.mjs"],"sourcesContent":["import { domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace } from \"@internal/contract/types\";\nimport { AsyncIterableResult } from \"@internal/framework-components/runtime\";\nimport { AggregateCommand, DeleteManyCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, InsertOneCommand, MongoAndExpr, MongoFieldFilter, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoProjectStage, MongoSkipStage, MongoSortStage, MongoUnwindStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, freezeMongoResultShape, isMongoFilterExpr } from \"@internal/mongo-query-ast/execution\";\nimport { contractFieldToMongoFieldShape, contractModelToMongoResultShape } from \"@internal/mongo-query-builder\";\nimport { MongoParamRef } from \"@internal/mongo-value\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/collection-state.ts\nfunction emptyCollectionState() {\n\treturn {\n\t\tfilters: [],\n\t\tincludes: [],\n\t\torderBy: void 0,\n\t\tselectedFields: void 0,\n\t\tlimit: void 0,\n\t\toffset: void 0\n\t};\n}\n//#endregion\n//#region src/compile.ts\nfunction compileIncludes(includes) {\n\tconst stages = [];\n\tfor (const inc of includes) {\n\t\tstages.push(new MongoLookupStage({\n\t\t\tfrom: inc.from,\n\t\t\tlocalField: inc.localField,\n\t\t\tforeignField: inc.foreignField,\n\t\t\tas: inc.relationName\n\t\t}));\n\t\tif (inc.cardinality === \"N:1\" || inc.cardinality === \"1:1\") stages.push(new MongoUnwindStage(`$${inc.relationName}`, true));\n\t}\n\treturn stages;\n}\nfunction compileMongoQuery(collection, state, storageHash, model) {\n\tconst stages = [];\n\tconst singleFilter = state.filters.length === 1 ? state.filters[0] : void 0;\n\tif (singleFilter) stages.push(new MongoMatchStage(singleFilter));\n\telse if (state.filters.length > 1) stages.push(new MongoMatchStage(MongoAndExpr.of([...state.filters])));\n\tif (state.includes.length > 0) stages.push(...compileIncludes(state.includes));\n\tif (state.orderBy) stages.push(new MongoSortStage(state.orderBy));\n\tif (state.offset !== void 0) stages.push(new MongoSkipStage(state.offset));\n\tif (state.limit !== void 0) stages.push(new MongoLimitStage(state.limit));\n\tif (state.selectedFields && state.selectedFields.length > 0) {\n\t\tconst projection = {};\n\t\tfor (const field of state.selectedFields) projection[field] = 1;\n\t\tif (!Object.hasOwn(projection, \"_id\")) projection[\"_id\"] = 0;\n\t\tstages.push(new MongoProjectStage(projection));\n\t}\n\tconst meta = {\n\t\ttarget: \"mongo\",\n\t\tstorageHash,\n\t\tlane: \"mongo-orm\"\n\t};\n\tconst command = new AggregateCommand(collection, stages);\n\tconst selection = state.selectedFields !== void 0 && state.selectedFields.length > 0 ? state.selectedFields : void 0;\n\tconst includeRelationNames = state.includes.length > 0 ? state.includes.map((inc) => inc.relationName) : void 0;\n\treturn {\n\t\tcollection,\n\t\tcommand,\n\t\tmeta,\n\t\tresultShape: contractModelToMongoResultShape(model, {\n\t\t\t...ifDefined(\"selection\", selection),\n\t\t\t...ifDefined(\"includeRelationNames\", includeRelationNames)\n\t\t})\n\t};\n}\n//#endregion\n//#region src/field-accessor.ts\nfunction createFieldExpression(fieldPath) {\n\treturn {\n\t\tset(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$set\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tunset() {\n\t\t\treturn {\n\t\t\t\toperator: \"$unset\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(\"\")\n\t\t\t};\n\t\t},\n\t\tinc(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$inc\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tmul(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$mul\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpush(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$push\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpull(match) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pull\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(match)\n\t\t\t};\n\t\t},\n\t\taddToSet(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$addToSet\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpop(end) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pop\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(end)\n\t\t\t};\n\t\t}\n\t};\n}\nfunction createFieldAccessor() {\n\treturn new Proxy((() => {}), {\n\t\tget(_target, prop) {\n\t\t\treturn createFieldExpression(prop);\n\t\t},\n\t\tapply(_target, _thisArg, args) {\n\t\t\treturn createFieldExpression(args[0]);\n\t\t}\n\t});\n}\nfunction compileFieldOperations(ops, wrapValue) {\n\tconst grouped = {};\n\tfor (const op of ops) {\n\t\tlet group = grouped[op.operator];\n\t\tif (!group) {\n\t\t\tgroup = {};\n\t\t\tgrouped[op.operator] = group;\n\t\t}\n\t\tgroup[op.field] = wrapValue(op.field, op.value, op.operator);\n\t}\n\treturn grouped;\n}\n//#endregion\n//#region src/orm-errors.ts\nfunction ormError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/collection.ts\nfunction resolveCollectionName(model, modelName) {\n\treturn model.storage.collection ?? modelName;\n}\nfunction isUnknownRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nvar MongoCollectionImpl = class MongoCollectionImpl {\n\t#contract;\n\t#modelName;\n\t#executor;\n\t#collectionName;\n\t#state;\n\t#variantName;\n\tconstructor(contract, modelName, executor) {\n\t\tthis.#contract = contract;\n\t\tthis.#modelName = modelName;\n\t\tthis.#executor = executor;\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(contract.domain)[modelName]);\n\t\tthis.#collectionName = resolveCollectionName(model, modelName);\n\t\tthis.#state = emptyCollectionState();\n\t}\n\tvariant(variantName) {\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model?.discriminator || !model.variants) return blindCast(this);\n\t\tconst variantEntry = model.variants[variantName];\n\t\tif (!variantEntry) return blindCast(this);\n\t\tconst filter = MongoFieldFilter.eq(model.discriminator.field, new MongoParamRef(variantEntry.value));\n\t\treturn this.#cloneWithVariant({ filters: [...this.#state.filters, filter] }, variantName);\n\t}\n\twhere(filter) {\n\t\tif (isMongoFilterExpr(filter)) return this.#clone({ filters: [...this.#state.filters, filter] });\n\t\tconst compiled = this.#compileWhereObject(blindCast(filter));\n\t\treturn this.#clone({ filters: [...this.#state.filters, ...compiled] });\n\t}\n\tselect(...fields) {\n\t\treturn this.#clone({ selectedFields: [...this.#state.selectedFields ?? [], ...fields] });\n\t}\n\tinclude(relationName) {\n\t\tconst relation = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]).relations?.[relationName];\n\t\tif (!relation) throw ormError(\"ORM.RELATION_UNKNOWN\", `Unknown relation \"${relationName}\" on model \"${this.#modelName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tif (!(\"on\" in relation)) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Relation \"${relationName}\" is an embed relation — only reference relations can be included`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst ref = relation;\n\t\tconst localField = ref.on.localFields[0];\n\t\tconst foreignField = ref.on.targetFields[0];\n\t\tif (!localField || !foreignField || ref.on.localFields.length !== 1 || ref.on.targetFields.length !== 1) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Compound references are not yet supported: relation \"${relationName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst targetModelName = ref.to.model;\n\t\tconst targetModel = castAs(domainModelsAtDefaultNamespace(this.#contract.domain)[targetModelName]);\n\t\tif (!targetModel) throw new InternalError(`Target model \"${targetModelName}\" not found for relation \"${relationName}\"`);\n\t\tconst includeExpr = {\n\t\t\trelationName,\n\t\t\tfrom: resolveCollectionName(targetModel, targetModelName),\n\t\t\tlocalField,\n\t\t\tforeignField,\n\t\t\tcardinality: ref.cardinality\n\t\t};\n\t\treturn blindCast(this.#clone({ includes: [...this.#state.includes, includeExpr] }));\n\t}\n\torderBy(spec) {\n\t\tconst merged = {\n\t\t\t...this.#state.orderBy,\n\t\t\t...spec\n\t\t};\n\t\treturn this.#clone({ orderBy: merged });\n\t}\n\ttake(n) {\n\t\treturn this.#clone({ limit: n });\n\t}\n\tskip(n) {\n\t\treturn this.#clone({ offset: n });\n\t}\n\tall() {\n\t\treturn this.#query();\n\t}\n\tasync first() {\n\t\tconst result = this.#clone({ limit: 1 }).#query();\n\t\tfor await (const row of result) return row;\n\t\treturn null;\n\t}\n\tasync create(data) {\n\t\tthis.#rejectIncludes(\"create\");\n\t\tconst normalized = this.#injectDiscriminator(this.#stripUndefined(blindCast(data)));\n\t\tconst document = this.#toDocument(normalized);\n\t\tconst command = new InsertOneCommand(this.#collectionName, document);\n\t\tconst insertedId = blindCast((await this.#drainPlan(command, this.#insertOneResultShape()))[0]).insertedId;\n\t\treturn blindCast({\n\t\t\t_id: insertedId,\n\t\t\t...normalized\n\t\t});\n\t}\n\tcreateAll(data) {\n\t\tthis.#rejectIncludes(\"createAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst normalizedRows = data.map((d) => self.#injectDiscriminator(self.#stripUndefined(blindCast(d))));\n\t\t\tconst documents = normalizedRows.map((d) => self.#toDocument(d));\n\t\t\tconst command = new InsertManyCommand(self.#collectionName, documents);\n\t\t\tconst insertedIds = blindCast((await self.#drainPlan(command, self.#insertManyResultShape()))[0]).insertedIds;\n\t\t\tfor (let i = 0; i < normalizedRows.length; i++) yield blindCast({\n\t\t\t\t_id: insertedIds[i],\n\t\t\t\t...normalizedRows[i]\n\t\t\t});\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync createAndCount(data) {\n\t\tthis.#rejectIncludes(\"createAndCount\");\n\t\tconst documents = data.map((d) => this.#toDocument(this.#injectDiscriminator(blindCast(d))));\n\t\tconst command = new InsertManyCommand(this.#collectionName, documents);\n\t\treturn blindCast((await this.#drainPlan(command))[0]).insertedCount;\n\t}\n\tasync update(dataOrCallback) {\n\t\tthis.#requireFilters(\"update\");\n\t\tthis.#rejectWindowing(\"update\");\n\t\tthis.#rejectIncludes(\"update\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#resolveUpdateDoc(dataOrCallback);\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, updateDoc, false);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(result);\n\t}\n\tupdateAll(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAll\");\n\t\tthis.#rejectWindowing(\"updateAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst ids = await self.#readMatchingIds();\n\t\t\tif (ids.length === 0) return;\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst updateDoc = self.#resolveUpdateDoc(dataOrCallback);\n\t\t\tconst command = new UpdateManyCommand(self.#collectionName, filter, updateDoc);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tconst idFilter = MongoFieldFilter.in(\"_id\", ids.map((id) => new MongoParamRef(id)));\n\t\t\tyield* self.#clone({ filters: [idFilter] }).#query();\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync updateAndCount(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAndCount\");\n\t\tthis.#rejectWindowing(\"updateAndCount\");\n\t\tthis.#rejectIncludes(\"updateAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#resolveUpdateDoc(dataOrCallback);\n\t\tconst command = new UpdateManyCommand(this.#collectionName, filter, updateDoc);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync delete() {\n\t\tthis.#requireFilters(\"delete\");\n\t\tthis.#rejectWindowing(\"delete\");\n\t\tthis.#rejectIncludes(\"delete\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new FindOneAndDeleteCommand(this.#collectionName, filter);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(result);\n\t}\n\tdeleteAll() {\n\t\tthis.#requireFilters(\"deleteAll\");\n\t\tthis.#rejectWindowing(\"deleteAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst docs = [];\n\t\t\tfor await (const row of self.#query()) docs.push(row);\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst command = new DeleteManyCommand(self.#collectionName, filter);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tyield* docs;\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync deleteAndCount() {\n\t\tthis.#requireFilters(\"deleteAndCount\");\n\t\tthis.#rejectWindowing(\"deleteAndCount\");\n\t\tthis.#rejectIncludes(\"deleteAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new DeleteManyCommand(this.#collectionName, filter);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync upsert(input) {\n\t\tthis.#requireFilters(\"upsert\");\n\t\tthis.#rejectWindowing(\"upsert\");\n\t\tthis.#rejectIncludes(\"upsert\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst allCreateFields = this.#toDocument(this.#injectDiscriminator(blindCast(input.create)));\n\t\tlet updateDoc;\n\t\tif (typeof input.update === \"function\") {\n\t\t\tconst accessor = createFieldAccessor();\n\t\t\tconst ops = input.update(accessor);\n\t\t\tif (ops.find((op) => op.field === \"_id\")) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tconst dotPathOp = ops.find((op) => op.field.includes(\".\"));\n\t\t\tif (dotPathOp) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `upsert() does not support dot-path field operations (found \"${dotPathOp.field}\"). Dot-path updates conflict with \\$setOnInsert on the insert path, producing incomplete documents. Use top-level field operations instead.`, { meta: {\n\t\t\t\tmethod: \"upsert\",\n\t\t\t\tfield: dotPathOp.field\n\t\t\t} });\n\t\t\tupdateDoc = compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator));\n\t\t} else {\n\t\t\tconst setFields = this.#toSetFields(blindCast(input.update));\n\t\t\tupdateDoc = {};\n\t\t\tif (Object.keys(setFields).length > 0) updateDoc[\"$set\"] = setFields;\n\t\t}\n\t\tconst updatedFields = /* @__PURE__ */ new Set();\n\t\tfor (const operatorGroup of Object.values(updateDoc)) for (const fieldPath of Object.keys(operatorGroup)) updatedFields.add(fieldPath.split(\".\")[0] ?? fieldPath);\n\t\tconst insertOnlyFields = {};\n\t\tfor (const [key, value] of Object.entries(allCreateFields)) if (!updatedFields.has(key)) insertOnlyFields[key] = value;\n\t\tif (Object.keys(insertOnlyFields).length > 0) updateDoc[\"$setOnInsert\"] = insertOnlyFields;\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, updateDoc, true);\n\t\treturn blindCast((await this.#drainPlan(command, this.#modelResultShape()))[0]);\n\t}\n\tasync #readMatchingIds() {\n\t\tconst idQuery = this.#clone({\n\t\t\tincludes: [],\n\t\t\tselectedFields: [\"_id\"],\n\t\t\torderBy: void 0,\n\t\t\tlimit: void 0,\n\t\t\toffset: void 0\n\t\t});\n\t\tconst ids = [];\n\t\tconst { resultShape: _rs, ...planWithoutShape } = idQuery.#compile();\n\t\tfor await (const row of this.#executor.query(planWithoutShape)) {\n\t\t\tconst storageRow = blindCast(row);\n\t\t\tids.push(storageRow[\"_id\"]);\n\t\t}\n\t\treturn ids;\n\t}\n\t#query() {\n\t\tconst plan = this.#compile();\n\t\treturn this.#executor.query(plan);\n\t}\n\t#compile() {\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model: \"${this.#modelName}\".`, { meta: { model: this.#modelName } });\n\t\treturn compileMongoQuery(this.#collectionName, this.#state, this.#contract.storage.storageHash, model);\n\t}\n\t#wrapCommand(command, resultShape) {\n\t\treturn {\n\t\t\tcollection: this.#collectionName,\n\t\t\tcommand,\n\t\t\tmeta: this.#planMeta(),\n\t\t\t...ifDefined(\"resultShape\", resultShape)\n\t\t};\n\t}\n\t#executePlan(command) {\n\t\treturn this.#executor.execute(this.#wrapCommand(command));\n\t}\n\tasync #drainPlan(command, resultShape) {\n\t\tconst plan = this.#wrapCommand(command, resultShape);\n\t\tconst result = this.#executor.query(plan);\n\t\tconst rows = [];\n\t\tfor await (const row of result) rows.push(row);\n\t\treturn rows;\n\t}\n\t#modelFields() {\n\t\treturn blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName])?.fields ?? {};\n\t}\n\t#idFieldShape() {\n\t\tconst idField = this.#modelFields()[\"_id\"];\n\t\treturn idField ? contractFieldToMongoFieldShape(idField) : Object.freeze({ kind: \"unknown\" });\n\t}\n\t#insertOneResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: { insertedId: this.#idFieldShape() }\n\t\t});\n\t}\n\t#insertManyResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: { insertedIds: {\n\t\t\t\tkind: \"array\",\n\t\t\t\tnullable: false,\n\t\t\t\telement: this.#idFieldShape()\n\t\t\t} }\n\t\t});\n\t}\n\t#modelResultShape() {\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model) return Object.freeze({ kind: \"unknown\" });\n\t\treturn contractModelToMongoResultShape(model);\n\t}\n\t#compileWhereObject(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst filters = [];\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst wrapped = this.#wrapFieldValue(value, fields[key]);\n\t\t\tfilters.push(MongoFieldFilter.eq(key, wrapped));\n\t\t}\n\t\treturn filters;\n\t}\n\t#wrapFieldValue(value, field) {\n\t\tif (field === void 0) return new MongoParamRef(value);\n\t\tif (field.type.kind === \"scalar\") return new MongoParamRef(value, { codecId: field.type.codecId });\n\t\tif (field.type.kind === \"valueObject\") {\n\t\t\tconst voName = field.type.name;\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\tif (!voDef || value === null) return new MongoParamRef(value);\n\t\t\tif (field.many && Array.isArray(value)) return value.map((item) => this.#wrapValueObject(blindCast(item), voDef));\n\t\t\treturn this.#wrapValueObject(blindCast(value), voDef);\n\t\t}\n\t\treturn new MongoParamRef(value);\n\t}\n\t#wrapValueObject(data, voDef) {\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst fieldDef = voDef.fields[key];\n\t\t\tdoc[key] = this.#wrapFieldValue(value, fieldDef);\n\t\t}\n\t\treturn doc;\n\t}\n\t#toDocument(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) if (value !== void 0) doc[key] = this.#wrapFieldValue(value, fields[key]);\n\t\treturn doc;\n\t}\n\t#toSetFields(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (key === \"_id\" && value !== void 0) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tif (value !== void 0) result[key] = this.#wrapFieldValue(value, fields[key]);\n\t\t}\n\t\treturn result;\n\t}\n\t#stripUndefined(data) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) if (value !== void 0) result[key] = value;\n\t\treturn result;\n\t}\n\t#toUpdateDocument(data) {\n\t\treturn { $set: this.#toSetFields(data) };\n\t}\n\t#resolveUpdateDoc(dataOrCallback) {\n\t\tif (typeof dataOrCallback === \"function\") {\n\t\t\tconst ops = dataOrCallback(createFieldAccessor());\n\t\t\tif (ops.find((op) => op.field === \"_id\")) throw ormError(\"ORM.FIELD_IMMUTABLE\", \"Mutation payloads cannot modify `_id`\", { meta: { field: \"_id\" } });\n\t\t\tif (ops.length === 0) return { $set: {} };\n\t\t\treturn compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator));\n\t\t}\n\t\treturn this.#toUpdateDocument(blindCast(dataOrCallback));\n\t}\n\t#wrapFieldOpValue(field, value, operator) {\n\t\tif (operator === \"$unset\") return value;\n\t\tconst topLevelField = field.split(\".\")[0] ?? field;\n\t\tconst contractField = this.#modelFields()[topLevelField];\n\t\tif (!contractField) return value;\n\t\tif (field.includes(\".\")) return this.#wrapDotPathValue(field, value);\n\t\tif (value instanceof MongoParamRef && contractField.type.kind === \"scalar\") return new MongoParamRef(value.value, { codecId: contractField.type.codecId });\n\t\tif (contractField.type.kind === \"valueObject\" && value instanceof MongoParamRef) {\n\t\t\tconst raw = value.value;\n\t\t\tif (isUnknownRecord(raw)) {\n\t\t\t\tconst voName = contractField.type.name;\n\t\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\t\tif (voDef) return this.#wrapValueObject(raw, voDef);\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n\t#wrapDotPathValue(dotPath, value) {\n\t\tconst parts = dotPath.split(\".\");\n\t\tconst fields = this.#modelFields();\n\t\tlet currentField = parts[0] ? fields[parts[0]] : void 0;\n\t\tfor (let i = 1; i < parts.length; i++) {\n\t\t\tif (currentField?.type.kind !== \"valueObject\") return value;\n\t\t\tconst voName = currentField.type.name;\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\tif (!voDef) return value;\n\t\t\tconst partKey = parts[i];\n\t\t\tcurrentField = partKey ? voDef.fields[partKey] : void 0;\n\t\t}\n\t\tif (currentField?.type.kind === \"scalar\" && value instanceof MongoParamRef) return new MongoParamRef(value.value, { codecId: currentField.type.codecId });\n\t\tif (currentField?.type.kind === \"valueObject\" && value instanceof MongoParamRef) {\n\t\t\tconst raw = value.value;\n\t\t\tif (isUnknownRecord(raw)) {\n\t\t\t\tconst voName = currentField.type.name;\n\t\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\t\tif (voDef) return this.#wrapValueObject(raw, voDef);\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n\t#mergeFilters() {\n\t\tconst [single] = this.#state.filters;\n\t\tif (this.#state.filters.length === 1 && single) return single;\n\t\treturn MongoAndExpr.of([...this.#state.filters]);\n\t}\n\t#requireFilters(methodName) {\n\t\tif (this.#state.filters.length === 0) throw ormError(\"ORM.WHERE_MISSING\", `${methodName}() requires a .where() filter. Call .where() before .${methodName}()`, { meta: { method: methodName } });\n\t}\n\t#rejectWindowing(methodName) {\n\t\tif (this.#state.orderBy !== void 0 || this.#state.limit !== void 0 || this.#state.offset !== void 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support orderBy/skip/take. Remove windowing before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"windowing\"\n\t\t} });\n\t}\n\t#rejectIncludes(methodName) {\n\t\tif (this.#state.includes.length > 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support .include(). Remove includes before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"includes\"\n\t\t} });\n\t}\n\t#planMeta() {\n\t\treturn {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: this.#contract.storage.storageHash,\n\t\t\tlane: \"mongo-orm\"\n\t\t};\n\t}\n\t#injectDiscriminator(data) {\n\t\tif (!this.#variantName) return data;\n\t\tconst model = blindCast(domainModelsAtDefaultNamespace(this.#contract.domain)[this.#modelName]);\n\t\tif (!model?.discriminator || !model.variants) return data;\n\t\tconst variantEntry = model.variants[this.#variantName];\n\t\tif (!variantEntry) return data;\n\t\treturn {\n\t\t\t...data,\n\t\t\t[model.discriminator.field]: variantEntry.value\n\t\t};\n\t}\n\t#clone(overrides) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantName = this.#variantName;\n\t\treturn instance;\n\t}\n\t#cloneWithVariant(overrides, variantName) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantName = variantName;\n\t\treturn instance;\n\t}\n};\nfunction createMongoCollection(contract, modelName, executor) {\n\treturn new MongoCollectionImpl(contract, modelName, executor);\n}\n//#endregion\n//#region src/mongo-orm.ts\nfunction mongoOrm(options) {\n\tconst { contract, executor } = options;\n\tconst client = {};\n\tfor (const [rootName, rootRef] of Object.entries(contract.roots)) client[rootName] = createMongoCollection(contract, blindCast(rootRef.model), executor);\n\treturn client;\n}\n//#endregion\n//#region src/raw-collection.ts\nfunction createRawMongoCollection(collectionName, meta) {\n\tfunction buildable(command) {\n\t\treturn { build: () => ({\n\t\t\tcollection: collectionName,\n\t\t\tcommand,\n\t\t\tmeta\n\t\t}) };\n\t}\n\treturn {\n\t\taggregate(pipeline) {\n\t\t\treturn buildable(new RawAggregateCommand(collectionName, pipeline));\n\t\t},\n\t\tinsertOne(document) {\n\t\t\treturn buildable(new RawInsertOneCommand(collectionName, document));\n\t\t},\n\t\tinsertMany(documents) {\n\t\t\treturn buildable(new RawInsertManyCommand(collectionName, documents));\n\t\t},\n\t\tupdateOne(filter, update) {\n\t\t\treturn buildable(new RawUpdateOneCommand(collectionName, filter, update));\n\t\t},\n\t\tupdateMany(filter, update) {\n\t\t\treturn buildable(new RawUpdateManyCommand(collectionName, filter, update));\n\t\t},\n\t\tdeleteOne(filter) {\n\t\t\treturn buildable(new RawDeleteOneCommand(collectionName, filter));\n\t\t},\n\t\tdeleteMany(filter) {\n\t\t\treturn buildable(new RawDeleteManyCommand(collectionName, filter));\n\t\t},\n\t\tfindOneAndUpdate(filter, update, options) {\n\t\t\treturn buildable(new RawFindOneAndUpdateCommand(collectionName, filter, update, options?.upsert ?? false));\n\t\t},\n\t\tfindOneAndDelete(filter) {\n\t\t\treturn buildable(new RawFindOneAndDeleteCommand(collectionName, filter));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/mongo-raw.ts\nfunction mongoRaw(options) {\n\tconst { contract } = options;\n\treturn { collection(rootName) {\n\t\tconst modelName = contract.roots[rootName]?.model;\n\t\tconst models = domainModelsAtDefaultNamespace(contract.domain);\n\t\tif (!modelName || !Object.hasOwn(models, modelName)) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model \"${modelName ?? \"\"}\" for root \"${rootName}\"`, { meta: {\n\t\t\tmodel: modelName ?? \"\",\n\t\t\troot: rootName\n\t\t} });\n\t\treturn createRawMongoCollection(models[modelName].storage.collection ?? modelName, {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: contract.storage.storageHash,\n\t\t\tlane: \"mongo-raw\"\n\t\t});\n\t} };\n}\n//#endregion\nexport { compileMongoQuery, createFieldAccessor, createMongoCollection, mongoOrm, mongoRaw };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;AAUA,SAAS,uBAAuB;CAC/B,OAAO;EACN,SAAS,CAAC;EACV,UAAU,CAAC;EACX,SAAS,KAAK;EACd,gBAAgB,KAAK;EACrB,OAAO,KAAK;EACZ,QAAQ,KAAK;CACd;AACD;AAGA,SAAS,gBAAgB,UAAU;CAClC,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,OAAO,UAAU;EAC3B,OAAO,KAAK,IAAI,iBAAiB;GAChC,MAAM,IAAI;GACV,YAAY,IAAI;GAChB,cAAc,IAAI;GAClB,IAAI,IAAI;EACT,CAAC,CAAC;EACF,IAAI,IAAI,gBAAgB,SAAS,IAAI,gBAAgB,OAAO,OAAO,KAAK,IAAI,iBAAiB,IAAI,IAAI,gBAAgB,IAAI,CAAC;CAC3H;CACA,OAAO;AACR;AACA,SAAS,kBAAkB,YAAY,OAAO,aAAa,OAAO;CACjE,MAAM,SAAS,CAAC;CAChB,MAAM,eAAe,MAAM,QAAQ,WAAW,IAAI,MAAM,QAAQ,KAAK,KAAK;CAC1E,IAAI,cAAc,OAAO,KAAK,IAAI,gBAAgB,YAAY,CAAC;MAC1D,IAAI,MAAM,QAAQ,SAAS,GAAG,OAAO,KAAK,IAAI,gBAAgB,aAAa,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC;CACvG,IAAI,MAAM,SAAS,SAAS,GAAG,OAAO,KAAK,GAAG,gBAAgB,MAAM,QAAQ,CAAC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AM,CAAC;EACxE;CACD;AACD;AAGA,SAAS,SAAS,SAAS;CAC1B,MAAM,EAAE,aAAa;CACrB,OAAO,EAAE,WAAW,UAAU;EAC7B,MAAM,YAAY,SAAS,MAAM,SAAS,EAAE;EAC5C,MAAM,SAAS,+BAA+B,SAAS,MAAM;EAC7D,IAAI,CAAC,aAAa,CAAC,OAAO,OAAO,QAAQ,SAAS,GAAG,MAAM,SAAS,qBAAqB,kBAAkB,aAAa,GAAG,cAAc,SAAS,IAAI,EAAE,MAAM;GAC7J,OAAO,aAAa;GACpB,MAAM;EACP,EAAE,CAAC;EACH,OAAO,yBAAyB,OAAO,UAAU,CAAC,QAAQ,cAAc,WAAW;GAClF,QAAQ;GACR,aAAa,SAAS,QAAQ;GAC9B,MAAM;EACP,CAAC;CACF,EAAE;AACH"}
|
|
1
|
+
{"version":3,"file":"orm.mjs","names":["#contract","#modelName","#executor","#mutationDefaults","#enums","#collectionName","#state","#variantValue","#cloneWithVariant","#encodeFieldFilter","#storedPath","#clone","#compileWhereObject","#storedNames","#query","#rejectIncludes","#withCreateDefaults","#injectDiscriminator","#stripUndefined","#toDocument","#drainPlan","#insertOneResultShape","#rowOf","#insertManyResultShape","#requireFilters","#rejectWindowing","#mergeFilters","#withUpdateDefaults","#resolveUpdateDoc","#modelResultShape","#readMatchingIds","#executePlan","#rejectDocumentIdOps","#wrapFieldOpValue","#toSetFields","#storedKeys","#upsertCommand","#compile","#rowMapper","#variantModelName","#modelWithVariantFields","#valueObjects","#planMeta","#wrapCommand","#idFieldShape","#documentShape","#modelFields","#wrapFieldValue","#fieldAtPath","#nullParam","#assertEnumValues","#scalarParam","#wrapValueObject","#fieldParam","#appliedDefaults","#toUpdateDocument"],"sources":["../../../../2-mongo-family/5-query-builders/orm/dist/index.mjs"],"sourcesContent":["import { domainValueObjectsAtDefaultNamespace } from \"@internal/contract/types\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { AsyncIterableResult, runtimeError } from \"@internal/framework-components/runtime\";\nimport { defaultMongoDomainNamespaceId, mongoModelsOf, ownDocumentIdFieldOf, ownEmbedStoredNamesOf, ownStoredNamesOf, storedNamesOf } from \"@internal/mongo-contract\";\nimport { AggregateCommand, DeleteManyCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, InsertOneCommand, MongoAddFieldsStage, MongoAggArrayFilter, MongoAggCond, MongoAggFieldRef, MongoAggLiteral, MongoAggMap, MongoAggOperator, MongoAndExpr, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoProjectStage, MongoSkipStage, MongoSortStage, MongoUnwindStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, freezeMongoResultShape, isMongoFilterExpr } from \"@internal/mongo-query-ast/execution\";\nimport { contractFieldToMongoFieldShape, contractModelToMongoResultShape } from \"@internal/mongo-query-builder\";\nimport { MongoParamRef } from \"@internal/mongo-value\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/collection-state.ts\nfunction emptyCollectionState() {\n\treturn {\n\t\tfilters: [],\n\t\tincludes: [],\n\t\torderBy: void 0,\n\t\tselectedFields: void 0,\n\t\tlimit: void 0,\n\t\toffset: void 0\n\t};\n}\n//#endregion\n//#region src/compile.ts\nfunction isToOne(include) {\n\treturn include.cardinality === \"N:1\" || include.cardinality === \"1:1\";\n}\n/**\n* An included document is decoded through the related model's codecs, like the root document. A to-one include with no related document reads as `null`.\n*/\nfunction includeShape(include, valueObjects) {\n\tconst target = contractModelToMongoResultShape(include.targetModel, { valueObjects });\n\tconst fields = target.kind === \"document\" ? target.fields : {};\n\treturn isToOne(include) ? {\n\t\tkind: \"document\",\n\t\tnullable: true,\n\t\tfields\n\t} : {\n\t\tkind: \"array\",\n\t\tnullable: false,\n\t\telement: {\n\t\t\tkind: \"document\",\n\t\t\tnullable: false,\n\t\t\tfields\n\t\t}\n\t};\n}\nfunction compileIncludes(includes) {\n\tconst stages = [];\n\tfor (const inc of includes) {\n\t\tstages.push(new MongoLookupStage({\n\t\t\tfrom: inc.from,\n\t\t\tlocalField: inc.localField,\n\t\t\tforeignField: inc.foreignField,\n\t\t\tas: inc.relationName\n\t\t}));\n\t\tif (isToOne(inc)) stages.push(new MongoUnwindStage(`$${inc.relationName}`, true));\n\t}\n\treturn stages;\n}\nfunction compileMongoQuery(collection, state, storageHash, model, valueObjects) {\n\tconst stages = [];\n\tconst singleFilter = state.filters.length === 1 ? state.filters[0] : void 0;\n\tif (singleFilter) stages.push(new MongoMatchStage(singleFilter));\n\telse if (state.filters.length > 1) stages.push(new MongoMatchStage(MongoAndExpr.of([...state.filters])));\n\tif (state.includes.length > 0) stages.push(...compileIncludes(state.includes));\n\tif (state.orderBy) stages.push(new MongoSortStage(state.orderBy));\n\tif (state.offset !== void 0) stages.push(new MongoSkipStage(state.offset));\n\tif (state.limit !== void 0) stages.push(new MongoLimitStage(state.limit));\n\tif (state.selectedFields && state.selectedFields.length > 0) {\n\t\tconst projection = {};\n\t\tfor (const field of state.selectedFields) projection[field] = 1;\n\t\tfor (const inc of state.includes) projection[inc.relationName] = 1;\n\t\tif (!Object.hasOwn(projection, \"_id\")) projection[\"_id\"] = 0;\n\t\tstages.push(new MongoProjectStage(projection));\n\t}\n\tconst meta = {\n\t\ttarget: \"mongo\",\n\t\tstorageHash,\n\t\tlane: \"mongo-orm\"\n\t};\n\treturn {\n\t\tcollection,\n\t\tcommand: new AggregateCommand(collection, stages),\n\t\tmeta,\n\t\tresultShape: contractModelToMongoResultShape(model, {\n\t\t\t...ifDefined(\"selection\", state.selectedFields !== void 0 && state.selectedFields.length > 0 ? state.selectedFields : void 0),\n\t\t\tincludes: Object.fromEntries(state.includes.map((inc) => [inc.relationName, includeShape(inc, valueObjects)])),\n\t\t\tvalueObjects\n\t\t})\n\t};\n}\n//#endregion\n//#region src/field-accessor.ts\nfunction createFieldExpression(fieldPath) {\n\treturn {\n\t\tset(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$set\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tunset() {\n\t\t\treturn {\n\t\t\t\toperator: \"$unset\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(\"\")\n\t\t\t};\n\t\t},\n\t\tinc(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$inc\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tmul(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$mul\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpush(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$push\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpull(match) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pull\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(match)\n\t\t\t};\n\t\t},\n\t\taddToSet(value) {\n\t\t\treturn {\n\t\t\t\toperator: \"$addToSet\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(value)\n\t\t\t};\n\t\t},\n\t\tpop(end) {\n\t\t\treturn {\n\t\t\t\toperator: \"$pop\",\n\t\t\t\tfield: fieldPath,\n\t\t\t\tvalue: new MongoParamRef(end)\n\t\t\t};\n\t\t}\n\t};\n}\nfunction createFieldAccessor() {\n\treturn new Proxy((() => {}), {\n\t\tget(_target, prop) {\n\t\t\treturn createFieldExpression(prop);\n\t\t},\n\t\tapply(_target, _thisArg, args) {\n\t\t\treturn createFieldExpression(args[0]);\n\t\t}\n\t});\n}\nfunction compileFieldOperations(ops, wrapValue, storedPathOf = (field) => field) {\n\tconst grouped = {};\n\tfor (const op of ops) {\n\t\tlet group = grouped[op.operator];\n\t\tif (!group) {\n\t\t\tgroup = {};\n\t\t\tgrouped[op.operator] = group;\n\t\t}\n\t\tgroup[storedPathOf(op.field)] = wrapValue(op.field, op.value, op.operator);\n\t}\n\treturn grouped;\n}\n//#endregion\n//#region src/orm-errors.ts\nfunction ormError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/model-stored-names.ts\nfunction invert(map) {\n\treturn Object.fromEntries(Object.entries(map).map(([key, value]) => [value, key]));\n}\nconst cachedStoredNames = /* @__PURE__ */ new WeakMap();\n/**\n* The stored names of model `modelName`'s fields, its own and those it inherits, and, when `variantModelName` is given, the fields of that variant. Embedded models are looked up when asked for, so a model that embeds itself reuses the same map at every level.\n*/\nfunction modelStoredNamesOf(contract, modelName, variantModelName) {\n\tconst cache = cachedStoredNames.get(contract) ?? /* @__PURE__ */ new Map();\n\tcachedStoredNames.set(contract, cache);\n\tconst key = JSON.stringify([modelName, variantModelName ?? null]);\n\tconst cached = cache.get(key);\n\tif (cached !== void 0) return cached;\n\tconst models = mongoModelsOf(contract.domain, defaultMongoDomainNamespaceId);\n\tconst model = models[modelName];\n\tconst variant = variantModelName === void 0 ? void 0 : models[variantModelName];\n\tconst storedNames = {\n\t\t...storedNamesOf(models, modelName),\n\t\t...variant === void 0 ? {} : ownStoredNamesOf(variant)\n\t};\n\tconst embedStoredNames = model === void 0 ? {} : ownEmbedStoredNamesOf(model);\n\tconst storedNamesOfModel = {\n\t\tmodelName,\n\t\tstoredNames,\n\t\tfieldNames: invert(storedNames),\n\t\tembedStoredNames,\n\t\tembedded(relationName) {\n\t\t\tif (!Object.hasOwn(embedStoredNames, relationName)) return void 0;\n\t\t\tconst target = model?.relations[relationName]?.to.model;\n\t\t\treturn target === void 0 ? void 0 : modelStoredNamesOf(contract, target);\n\t\t}\n\t};\n\tcache.set(key, storedNamesOfModel);\n\treturn storedNamesOfModel;\n}\n/** The refusal of a name a caller passed that is not a field of the model. */\nfunction callerFieldUnknown(names, fieldName) {\n\tconst unknown = `Model \"${names.modelName}\" has no field \"${fieldName}\"`;\n\tconst fieldForStoredName = Object.hasOwn(names.fieldNames, fieldName) ? names.fieldNames[fieldName] : void 0;\n\tif (fieldForStoredName !== void 0) return ormError(\"ORM.FIELD_UNKNOWN\", `${unknown}. \"${fieldName}\" is the stored name of field \"${fieldForStoredName}\"; pass the field name.`, { meta: {\n\t\tmodel: names.modelName,\n\t\tfield: fieldName,\n\t\tfieldForStoredName\n\t} });\n\treturn ormError(\"ORM.FIELD_UNKNOWN\", unknown, { meta: {\n\t\tmodel: names.modelName,\n\t\tfield: fieldName\n\t} });\n}\n/** The stored name of a field a caller named. A name that is not a field is refused with `ORM.FIELD_UNKNOWN`. */\nfunction storedNameOfCallerField(names, fieldName) {\n\tconst storedName = Object.hasOwn(names.storedNames, fieldName) ? names.storedNames[fieldName] : void 0;\n\tif (storedName === void 0) throw callerFieldUnknown(names, fieldName);\n\treturn storedName;\n}\n/**\n* The stored path of a dot path a caller named: its first segment is a field, or an embed relation, of the model; a value object stores the rest under their own names.\n*/\nfunction storedPathOfCallerPath(names, path) {\n\tconst [head = path, ...rest] = path.split(\".\");\n\tconst embed = Object.hasOwn(names.embedStoredNames, head) ? names.embedStoredNames[head] : void 0;\n\tif (embed === void 0) return [storedNameOfCallerField(names, head), ...rest].join(\".\");\n\tconst embeddedStorage = names.embedded(head);\n\tconst [next, ...afterNext] = rest;\n\tif (embeddedStorage === void 0 || next === void 0) return [embed, ...rest].join(\".\");\n\tif (/^\\d+$/.test(next)) return afterNext.length === 0 ? [embed, next].join(\".\") : [\n\t\tembed,\n\t\tnext,\n\t\tstoredPathOfCallerPath(embeddedStorage, afterNext.join(\".\"))\n\t].join(\".\");\n\treturn [embed, storedPathOfCallerPath(embeddedStorage, rest.join(\".\"))].join(\".\");\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction mapEach(value, map) {\n\tif (Array.isArray(value)) return value.map((element) => isRecord(element) ? map(element) : element);\n\treturn isRecord(value) ? map(value) : value;\n}\n/** A document of a model as a row of its fields: each stored name under the name of the field that stores it, embedded models likewise, and stored names no field stores left out. */\nfunction rowOfStoredDocument(document, names, extra = {}) {\n\tconst row = {};\n\tconst relationOfEmbed = invert(names.embedStoredNames);\n\tfor (const [storedName, value] of Object.entries(document)) {\n\t\tconst extraKey = Object.hasOwn(extra, storedName) ? extra[storedName] : void 0;\n\t\tif (extraKey !== void 0) {\n\t\t\trow[storedName] = extraKey(value);\n\t\t\tcontinue;\n\t\t}\n\t\tconst fieldName = Object.hasOwn(names.fieldNames, storedName) ? names.fieldNames[storedName] : void 0;\n\t\tif (fieldName !== void 0) {\n\t\t\trow[fieldName] = value;\n\t\t\tcontinue;\n\t\t}\n\t\tconst relationName = Object.hasOwn(relationOfEmbed, storedName) ? relationOfEmbed[storedName] : void 0;\n\t\tif (relationName === void 0) continue;\n\t\tconst embeddedStorage = names.embedded(relationName);\n\t\trow[relationName] = embeddedStorage === void 0 ? value : mapEach(value, (embedded) => rowOfStoredDocument(embedded, embeddedStorage));\n\t}\n\treturn row;\n}\n/** A row of a model's fields as the document that stores it, embedded models likewise. */\nfunction storedDocumentOfRow(row, names) {\n\tconst document = {};\n\tfor (const [name, value] of Object.entries(row)) {\n\t\tconst embed = Object.hasOwn(names.embedStoredNames, name) ? names.embedStoredNames[name] : void 0;\n\t\tif (embed === void 0) {\n\t\t\tdocument[storedNameOfCallerField(names, name)] = value;\n\t\t\tcontinue;\n\t\t}\n\t\tconst embeddedStorage = names.embedded(name);\n\t\tdocument[embed] = embeddedStorage === void 0 ? value : mapEach(value, (embedded) => storedDocumentOfRow(embedded, embeddedStorage));\n\t}\n\treturn document;\n}\n/**\n* Maps each document of model `modelName` to its row. A document of a model with variants is read with the fields of the variant its discriminator value names, unless `variantModelName` already names one; each included relation is read as rows of the model it reads.\n*/\nfunction documentRowMapper(contract, modelName, variantModelName, includes = {}) {\n\tconst model = mongoModelsOf(contract.domain, defaultMongoDomainNamespaceId)[modelName];\n\tconst base = modelStoredNamesOf(contract, modelName, variantModelName);\n\tconst discriminator = variantModelName === void 0 && model?.discriminator !== void 0 ? base.storedNames[model.discriminator.field] : void 0;\n\tconst namesOfVariant = (value) => {\n\t\tconst variantModel = typeof value === \"string\" ? model?.variants?.[value]?.model : void 0;\n\t\treturn variantModel === void 0 ? base : modelStoredNamesOf(contract, modelName, variantModel);\n\t};\n\tconst extra = Object.fromEntries(Object.entries(includes).map(([relationName, target]) => {\n\t\tconst targetRow = documentRowMapper(contract, target, void 0);\n\t\treturn [relationName, (value) => mapEach(value, targetRow)];\n\t}));\n\treturn (document) => {\n\t\tif (!isRecord(document)) return document;\n\t\treturn rowOfStoredDocument(document, discriminator === void 0 ? base : namesOfVariant(document[discriminator]), extra);\n\t};\n}\n//#endregion\n//#region src/upsert-pipeline.ts\nfunction fieldNamesIn(filter) {\n\tswitch (filter.kind) {\n\t\tcase \"field\":\n\t\tcase \"exists\": return [filter.field.split(\".\")[0] ?? filter.field];\n\t\tcase \"and\":\n\t\tcase \"or\": return filter.exprs.flatMap(fieldNamesIn);\n\t\tcase \"not\": return fieldNamesIn(filter.expr);\n\t\tcase \"expr\": return [];\n\t}\n}\n/**\n* True while the pipeline runs on the document an upsert is inserting. That document starts with only the equality fields the server copies from the filter, so every one of its keys is a field the filter names; a matched document always has an `_id` the filter does not name, or, when the filter names `_id`, fields besides the filter's.\n*/\nfunction isInsert(filter) {\n\tconst keys = new MongoAggMap(MongoAggOperator.of(\"$objectToArray\", MongoAggFieldRef.of(\"$ROOT\")), MongoAggFieldRef.of(\"$this.k\"), \"this\");\n\treturn MongoAggOperator.of(\"$setIsSubset\", [keys, MongoAggLiteral.of([...new Set(fieldNamesIn(filter))])]);\n}\nfunction orEmptyList(field) {\n\treturn MongoAggOperator.of(\"$ifNull\", [MongoAggFieldRef.of(field), MongoAggLiteral.of([])]);\n}\nfunction whenList(field, expr) {\n\treturn MongoAggCond.of(MongoAggOperator.of(\"$isArray\", MongoAggFieldRef.of(field)), expr, MongoAggFieldRef.of(field));\n}\nfunction popped(field, end) {\n\tconst size = MongoAggOperator.size(MongoAggFieldRef.of(field));\n\tconst rest = MongoAggOperator.subtract(size, MongoAggLiteral.of(1));\n\tconst kept = MongoAggOperator.of(\"$slice\", [\n\t\tMongoAggFieldRef.of(field),\n\t\tMongoAggLiteral.of(end === -1 ? 1 : 0),\n\t\trest\n\t]);\n\treturn whenList(field, MongoAggCond.of(MongoAggOperator.of(\"$lte\", [size, MongoAggLiteral.of(1)]), MongoAggLiteral.of([]), kept));\n}\nfunction operatorExpression(operator, field, value) {\n\tswitch (operator) {\n\t\tcase \"$set\": return MongoAggLiteral.of(value);\n\t\tcase \"$unset\": return MongoAggFieldRef.of(\"$REMOVE\");\n\t\tcase \"$inc\": return MongoAggOperator.add(MongoAggOperator.of(\"$ifNull\", [MongoAggFieldRef.of(field), MongoAggLiteral.of(0)]), MongoAggLiteral.of(value));\n\t\tcase \"$mul\": return MongoAggOperator.multiply(MongoAggOperator.of(\"$ifNull\", [MongoAggFieldRef.of(field), MongoAggLiteral.of(0)]), MongoAggLiteral.of(value));\n\t\tcase \"$push\": return MongoAggOperator.of(\"$concatArrays\", [orEmptyList(field), MongoAggLiteral.of([value])]);\n\t\tcase \"$addToSet\": return MongoAggCond.of(MongoAggOperator.of(\"$in\", [MongoAggLiteral.of(value), orEmptyList(field)]), orEmptyList(field), MongoAggOperator.of(\"$concatArrays\", [orEmptyList(field), MongoAggLiteral.of([value])]));\n\t\tcase \"$pull\":\n\t\t\tif (typeof value === \"object\" && value !== null && !(value instanceof MongoParamRef)) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `upsert() cannot pull by a match document from \"${field}\" when create sets a field that has an update default. Pull a single value, or leave that field out of create.`, { meta: {\n\t\t\t\tmethod: \"upsert\",\n\t\t\t\tfield\n\t\t\t} });\n\t\t\treturn whenList(field, MongoAggArrayFilter.of(MongoAggFieldRef.of(field), MongoAggOperator.of(\"$ne\", [MongoAggFieldRef.of(\"$this\"), MongoAggLiteral.of(value)]), \"this\"));\n\t\tcase \"$pop\": return popped(field, value instanceof MongoParamRef ? value.value : value);\n\t\tdefault: throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `upsert() cannot apply ${operator} to \"${field}\" when create sets a field that has an update default.`, { meta: {\n\t\t\tmethod: \"upsert\",\n\t\t\tfield,\n\t\t\toperator\n\t\t} });\n\t}\n}\n/**\n* The one-command form of an upsert whose `create` sets a field that also has an update default: an update pipeline that, on insert, writes every `create` value, including those fields, and on update applies the update and its defaults. Every value is a `$literal`, so a string such as `'$x'` is not read as a field path.\n*/\nfunction upsertPipeline(input) {\n\tconst inserting = isInsert(input.filter);\n\tconst fields = {};\n\tfor (const [operator, group] of Object.entries(input.update)) for (const [field, value] of Object.entries(group)) {\n\t\tconst onUpdate = operatorExpression(operator, field, value);\n\t\tconst created = input.create[field];\n\t\tfields[field] = operator === \"$set\" && input.createWins.has(field) && created !== void 0 ? MongoAggCond.of(inserting, MongoAggLiteral.of(created), onUpdate) : onUpdate;\n\t}\n\tfor (const [field, value] of Object.entries(input.create)) if (!Object.hasOwn(fields, field)) fields[field] = MongoAggCond.of(inserting, MongoAggLiteral.of(value), MongoAggFieldRef.of(field));\n\treturn [new MongoAddFieldsStage(fields)];\n}\n//#endregion\n//#region src/where-equality.ts\n/**\n* On a list, `{ field: null }` also matches an array holding a null item, and an upsert copies `{ field: element }` into the inserted document as a value that is not a list. So `null` on a list matches any value that is not an array, and one element matches a list item equal to it.\n*/\nfunction whereEquality(path, field, value) {\n\tif (field?.many) {\n\t\tif (value === null) return notAnArray(path);\n\t\tif (!Array.isArray(value)) return holdsItem(path, value);\n\t}\n\treturn MongoFieldFilter.eq(path, value);\n}\nfunction notAnArray(path) {\n\treturn MongoFieldFilter.of(path, \"$not\", { $type: \"array\" });\n}\nfunction holdsItem(path, item) {\n\treturn MongoFieldFilter.of(path, \"$elemMatch\", { $eq: item });\n}\n//#endregion\n//#region src/collection.ts\nconst COMPARISON_OPERATORS = /* @__PURE__ */ new Set([\n\t\"$eq\",\n\t\"$ne\",\n\t\"$gt\",\n\t\"$gte\",\n\t\"$lt\",\n\t\"$lte\"\n]);\nconst MEMBERSHIP_OPERATORS = /* @__PURE__ */ new Set([\"$in\", \"$nin\"]);\nfunction modelOf(contract, modelName) {\n\tconst model = mongoModelsOf(contract.domain, defaultMongoDomainNamespaceId)[modelName];\n\tif (model === void 0) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model: \"${modelName}\".`, { meta: { model: modelName } });\n\treturn model;\n}\nfunction resolveCollectionName(model, modelName) {\n\treturn model.storage.collection ?? modelName;\n}\nfunction topLevelUpdateFields(updateDoc) {\n\tconst fields = /* @__PURE__ */ new Set();\n\tfor (const operatorGroup of Object.values(updateDoc)) for (const fieldPath of Object.keys(operatorGroup)) fields.add(fieldPath.split(\".\")[0] ?? fieldPath);\n\treturn fields;\n}\nfunction describeValue(value) {\n\tif (typeof value === \"bigint\") return `${value}n`;\n\ttry {\n\t\treturn JSON.stringify(value) ?? String(value);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\nfunction isUnknownRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nvar MongoCollectionImpl = class MongoCollectionImpl {\n\t#contract;\n\t#modelName;\n\t#executor;\n\t#mutationDefaults;\n\t#enums;\n\t#collectionName;\n\t#state;\n\t#variantValue;\n\tconstructor(contract, modelName, executor, mutationDefaults, enums) {\n\t\tthis.#contract = contract;\n\t\tthis.#modelName = modelName;\n\t\tthis.#executor = executor;\n\t\tthis.#mutationDefaults = mutationDefaults;\n\t\tthis.#enums = enums;\n\t\tthis.#collectionName = resolveCollectionName(modelOf(contract, modelName), modelName);\n\t\tthis.#state = emptyCollectionState();\n\t}\n\tvariant(value) {\n\t\tconst model = mongoModelsOf(this.#contract.domain, defaultMongoDomainNamespaceId)[this.#modelName];\n\t\tconst discriminator = model?.discriminator;\n\t\tconst selectedValue = this.#variantValue;\n\t\tif (selectedValue !== void 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `variant(\"${value}\") cannot be called on model \"${this.#modelName}\" because variant(\"${selectedValue}\") is already selected; call variant() on the base collection instead`, { meta: {\n\t\t\tmethod: \"variant\",\n\t\t\tmodel: this.#modelName,\n\t\t\tvariant: model?.variants?.[selectedValue]?.model,\n\t\t\tselectedValue,\n\t\t\treason: \"variant-already-selected\"\n\t\t} });\n\t\tif (!discriminator || model?.variants?.[value] === void 0) {\n\t\t\tconst declaredValues = discriminator ? Object.keys(model?.variants ?? {}) : [];\n\t\t\tthrow ormError(\"ORM.ARGUMENT_INVALID\", declaredValues.length === 0 ? `variant(\"${value}\") cannot narrow model \"${this.#modelName}\": it declares no discriminator values` : `variant(\"${value}\") cannot narrow model \"${this.#modelName}\": the declared discriminator values are ${declaredValues.map((declared) => `\"${declared}\"`).join(\", \")}`, { meta: {\n\t\t\t\tmethod: \"variant\",\n\t\t\t\targument: \"value\",\n\t\t\t\tmodel: this.#modelName,\n\t\t\t\tvalue,\n\t\t\t\tdeclaredValues\n\t\t\t} });\n\t\t}\n\t\tconst filter = MongoFieldFilter.eq(storedNameOfCallerField(modelStoredNamesOf(this.#contract, this.#modelName), discriminator.field), new MongoParamRef(value));\n\t\treturn this.#cloneWithVariant({ filters: [...this.#state.filters, filter] }, value);\n\t}\n\twhere(filter) {\n\t\tif (isMongoFilterExpr(filter)) {\n\t\t\tconst encoded = filter.rewrite({\n\t\t\t\tfield: (fieldFilter) => this.#encodeFieldFilter(fieldFilter),\n\t\t\t\texists: (existsFilter) => new MongoExistsExpr(this.#storedPath(existsFilter.field), existsFilter.exists),\n\t\t\t\texpr: (exprFilter) => MongoExprFilter.of(exprFilter.aggExpr.rewrite({ fieldRef: (ref) => ref.path.startsWith(\"$\") ? ref : MongoAggFieldRef.of(this.#storedPath(ref.path)) }))\n\t\t\t});\n\t\t\treturn this.#clone({ filters: [...this.#state.filters, encoded] });\n\t\t}\n\t\tconst compiled = this.#compileWhereObject(blindCast(filter));\n\t\treturn this.#clone({ filters: [...this.#state.filters, ...compiled] });\n\t}\n\tselect(...fields) {\n\t\tconst storage = this.#storedNames();\n\t\treturn this.#clone({ selectedFields: [...this.#state.selectedFields ?? [], ...fields.map((field) => storedNameOfCallerField(storage, field))] });\n\t}\n\tinclude(relationName) {\n\t\tconst relation = modelOf(this.#contract, this.#modelName).relations?.[relationName];\n\t\tif (!relation) throw ormError(\"ORM.RELATION_UNKNOWN\", `Unknown relation \"${relationName}\" on model \"${this.#modelName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tif (!(\"on\" in relation)) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Relation \"${relationName}\" is an embed relation — only reference relations can be included`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst ref = relation;\n\t\tconst localField = ref.on.localFields[0];\n\t\tconst foreignField = ref.on.targetFields[0];\n\t\tif (!localField || !foreignField || ref.on.localFields.length !== 1 || ref.on.targetFields.length !== 1) throw ormError(\"ORM.INCLUDE_UNSUPPORTED\", `Compound references are not yet supported: relation \"${relationName}\"`, { meta: {\n\t\t\tmodel: this.#modelName,\n\t\t\trelation: relationName\n\t\t} });\n\t\tconst targetModelName = ref.to.model;\n\t\tconst targetModel = mongoModelsOf(this.#contract.domain, defaultMongoDomainNamespaceId)[targetModelName];\n\t\tif (!targetModel) throw new InternalError(`Target model \"${targetModelName}\" not found for relation \"${relationName}\"`);\n\t\tconst includeExpr = {\n\t\t\trelationName,\n\t\t\ttargetModelName,\n\t\t\ttargetModel,\n\t\t\tfrom: resolveCollectionName(targetModel, targetModelName),\n\t\t\tlocalField: storedNameOfCallerField(this.#storedNames(), localField),\n\t\t\tforeignField: storedNameOfCallerField(modelStoredNamesOf(this.#contract, targetModelName), foreignField),\n\t\t\tcardinality: ref.cardinality\n\t\t};\n\t\treturn blindCast(this.#clone({ includes: [...this.#state.includes, includeExpr] }));\n\t}\n\torderBy(spec) {\n\t\tconst storage = this.#storedNames();\n\t\tconst merged = {\n\t\t\t...this.#state.orderBy,\n\t\t\t...Object.fromEntries(Object.entries(spec).flatMap(([field, direction]) => direction === void 0 ? [] : [[storedNameOfCallerField(storage, field), direction]]))\n\t\t};\n\t\treturn this.#clone({ orderBy: merged });\n\t}\n\tlimit(n) {\n\t\treturn this.#clone({ limit: n });\n\t}\n\toffset(n) {\n\t\treturn this.#clone({ offset: n });\n\t}\n\tall() {\n\t\treturn this.#query();\n\t}\n\tasync first() {\n\t\tconst result = this.#clone({ limit: 1 }).#query();\n\t\tfor await (const row of result) return row;\n\t\treturn null;\n\t}\n\tasync firstOrThrow() {\n\t\treturn this.#clone({ limit: 1 }).#query().firstOrThrow();\n\t}\n\tasync create(data) {\n\t\tthis.#rejectIncludes(\"create\");\n\t\tconst normalized = this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(data))), /* @__PURE__ */ new Map());\n\t\tconst document = this.#toDocument(normalized);\n\t\tconst command = new InsertOneCommand(this.#collectionName, document);\n\t\tconst results = await this.#drainPlan(command, this.#insertOneResultShape());\n\t\treturn blindCast(this.#rowOf(blindCast(results[0]).document));\n\t}\n\tcreateAll(data) {\n\t\tthis.#rejectIncludes(\"createAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\t\tconst normalizedRows = data.map((d) => self.#withCreateDefaults(self.#injectDiscriminator(self.#stripUndefined(blindCast(d))), defaultValueCache));\n\t\t\tconst command = new InsertManyCommand(self.#collectionName, normalizedRows.map((d) => self.#toDocument(d)));\n\t\t\tconst { documents } = blindCast((await self.#drainPlan(command, self.#insertManyResultShape()))[0]);\n\t\t\tfor (const document of documents) yield blindCast(self.#rowOf(document));\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync createAndCount(data) {\n\t\tthis.#rejectIncludes(\"createAndCount\");\n\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\tconst documents = data.map((d) => this.#toDocument(this.#withCreateDefaults(this.#injectDiscriminator(this.#stripUndefined(blindCast(d))), defaultValueCache)));\n\t\tconst command = new InsertManyCommand(this.#collectionName, documents);\n\t\treturn blindCast((await this.#drainPlan(command))[0]).insertedCount;\n\t}\n\tasync update(dataOrCallback) {\n\t\tthis.#requireFilters(\"update\");\n\t\tthis.#rejectWindowing(\"update\");\n\t\tthis.#rejectIncludes(\"update\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#withUpdateDefaults(this.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, updateDoc, false);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(this.#rowOf(result));\n\t}\n\tupdateAll(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAll\");\n\t\tthis.#rejectWindowing(\"updateAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst ids = await self.#readMatchingIds();\n\t\t\tif (ids.length === 0) return;\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst updateDoc = self.#withUpdateDefaults(self.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\t\tconst command = new UpdateManyCommand(self.#collectionName, filter, updateDoc);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tconst idFilter = MongoFieldFilter.in(\"_id\", ids.map((id) => new MongoParamRef(id)));\n\t\t\tyield* self.#clone({ filters: [idFilter] }).#query();\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync updateAndCount(dataOrCallback) {\n\t\tthis.#requireFilters(\"updateAndCount\");\n\t\tthis.#rejectWindowing(\"updateAndCount\");\n\t\tthis.#rejectIncludes(\"updateAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst updateDoc = this.#withUpdateDefaults(this.#resolveUpdateDoc(dataOrCallback), /* @__PURE__ */ new Map());\n\t\tconst command = new UpdateManyCommand(this.#collectionName, filter, updateDoc);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync delete() {\n\t\tthis.#requireFilters(\"delete\");\n\t\tthis.#rejectWindowing(\"delete\");\n\t\tthis.#rejectIncludes(\"delete\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new FindOneAndDeleteCommand(this.#collectionName, filter);\n\t\tconst result = (await this.#drainPlan(command, this.#modelResultShape()))[0];\n\t\treturn result === void 0 ? null : blindCast(this.#rowOf(result));\n\t}\n\tdeleteAll() {\n\t\tthis.#requireFilters(\"deleteAll\");\n\t\tthis.#rejectWindowing(\"deleteAll\");\n\t\tconst self = this;\n\t\tasync function* gen() {\n\t\t\tconst docs = [];\n\t\t\tfor await (const row of self.#query()) docs.push(row);\n\t\t\tconst filter = self.#mergeFilters();\n\t\t\tconst command = new DeleteManyCommand(self.#collectionName, filter);\n\t\t\tawait self.#drainPlan(command);\n\t\t\tyield* docs;\n\t\t}\n\t\treturn new AsyncIterableResult(gen());\n\t}\n\tasync deleteAndCount() {\n\t\tthis.#requireFilters(\"deleteAndCount\");\n\t\tthis.#rejectWindowing(\"deleteAndCount\");\n\t\tthis.#rejectIncludes(\"deleteAndCount\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst command = new DeleteManyCommand(this.#collectionName, filter);\n\t\treturn (await this.#executePlan(command)).affectedRows;\n\t}\n\tasync upsert(input) {\n\t\tthis.#requireFilters(\"upsert\");\n\t\tthis.#rejectWindowing(\"upsert\");\n\t\tthis.#rejectIncludes(\"upsert\");\n\t\tconst filter = this.#mergeFilters();\n\t\tconst defaultValueCache = /* @__PURE__ */ new Map();\n\t\tconst explicitCreate = this.#injectDiscriminator(this.#stripUndefined(blindCast(input.create)));\n\t\tconst allCreateFields = this.#toDocument(this.#withCreateDefaults(explicitCreate, defaultValueCache));\n\t\tlet updateDoc;\n\t\tif (typeof input.update === \"function\") {\n\t\t\tconst accessor = createFieldAccessor();\n\t\t\tconst ops = input.update(accessor);\n\t\t\tthis.#rejectDocumentIdOps(ops);\n\t\t\tconst dotPathOp = ops.find((op) => op.field.includes(\".\"));\n\t\t\tif (dotPathOp) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `upsert() does not support dot-path field operations (found \"${dotPathOp.field}\"). Dot-path updates conflict with \\$setOnInsert on the insert path, producing incomplete documents. Use top-level field operations instead.`, { meta: {\n\t\t\t\tmethod: \"upsert\",\n\t\t\t\tfield: dotPathOp.field\n\t\t\t} });\n\t\t\tupdateDoc = compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator), (field) => this.#storedPath(field));\n\t\t} else {\n\t\t\tconst setFields = this.#toSetFields(blindCast(input.update));\n\t\t\tupdateDoc = {};\n\t\t\tif (Object.keys(setFields).length > 0) updateDoc[\"$set\"] = setFields;\n\t\t}\n\t\tconst explicitUpdateFields = topLevelUpdateFields(updateDoc);\n\t\tconst withUpdateDefaults = this.#withUpdateDefaults(updateDoc, defaultValueCache);\n\t\tconst explicitCreateFields = new Set(Object.keys(this.#storedKeys(explicitCreate)));\n\t\tconst generatedSetByCreate = Object.keys(withUpdateDefaults[\"$set\"] ?? {}).filter((field) => !explicitUpdateFields.has(field) && explicitCreateFields.has(field));\n\t\tif (generatedSetByCreate.length === 0) return this.#upsertCommand(filter, withUpdateDefaults, allCreateFields);\n\t\tconst results = await this.#drainPlan(new FindOneAndUpdateCommand(this.#collectionName, filter, upsertPipeline({\n\t\t\tfilter,\n\t\t\tupdate: withUpdateDefaults,\n\t\t\tcreate: allCreateFields,\n\t\t\tcreateWins: new Set(generatedSetByCreate)\n\t\t}), true), this.#modelResultShape());\n\t\treturn blindCast(this.#rowOf(results[0]));\n\t}\n\tasync #upsertCommand(filter, updateDoc, allCreateFields) {\n\t\tconst updatedFields = topLevelUpdateFields(updateDoc);\n\t\tconst insertOnlyFields = {};\n\t\tfor (const [key, value] of Object.entries(allCreateFields)) if (!updatedFields.has(key)) insertOnlyFields[key] = value;\n\t\tconst command = new FindOneAndUpdateCommand(this.#collectionName, filter, Object.keys(insertOnlyFields).length > 0 ? {\n\t\t\t...updateDoc,\n\t\t\t$setOnInsert: insertOnlyFields\n\t\t} : updateDoc, true);\n\t\tconst results = await this.#drainPlan(command, this.#modelResultShape());\n\t\treturn blindCast(this.#rowOf(results[0]));\n\t}\n\tasync #readMatchingIds() {\n\t\tconst idQuery = this.#clone({\n\t\t\tincludes: [],\n\t\t\tselectedFields: [\"_id\"],\n\t\t\torderBy: void 0,\n\t\t\tlimit: void 0,\n\t\t\toffset: void 0\n\t\t});\n\t\tconst ids = [];\n\t\tconst { resultShape: _rs, ...planWithoutShape } = idQuery.#compile();\n\t\tfor await (const row of this.#executor.query(planWithoutShape)) {\n\t\t\tconst storageRow = blindCast(row);\n\t\t\tids.push(storageRow[\"_id\"]);\n\t\t}\n\t\treturn ids;\n\t}\n\t#query() {\n\t\tconst plan = this.#compile();\n\t\tconst documents = this.#executor.query(plan);\n\t\tconst rowOf = this.#rowMapper();\n\t\tasync function* rows() {\n\t\t\tfor await (const document of documents) yield blindCast(rowOf(document));\n\t\t}\n\t\treturn new AsyncIterableResult(rows());\n\t}\n\t#rowMapper() {\n\t\treturn documentRowMapper(this.#contract, this.#modelName, this.#variantModelName(), Object.fromEntries(this.#state.includes.map((include) => [include.relationName, include.targetModelName])));\n\t}\n\t#rowOf(document) {\n\t\treturn this.#rowMapper()(document);\n\t}\n\t#variantModelName() {\n\t\tif (this.#variantValue === void 0) return void 0;\n\t\treturn mongoModelsOf(this.#contract.domain, defaultMongoDomainNamespaceId)[this.#modelName]?.variants?.[this.#variantValue]?.model;\n\t}\n\t#storedNames() {\n\t\treturn modelStoredNamesOf(this.#contract, this.#modelName, this.#variantModelName());\n\t}\n\t#storedPath(path) {\n\t\treturn storedPathOfCallerPath(this.#storedNames(), path);\n\t}\n\t#storedKeys(data) {\n\t\tconst storage = this.#storedNames();\n\t\treturn Object.fromEntries(Object.entries(data).map(([key, value]) => [storedPathOfCallerPath(storage, key), value]));\n\t}\n\t#rejectDocumentIdOps(ops) {\n\t\tconst idOp = ops.find((op) => this.#storedPath(op.field).split(\".\")[0] === \"_id\");\n\t\tif (idOp) throw ormError(\"ORM.FIELD_IMMUTABLE\", `Mutation payloads cannot modify \\`${idOp.field}\\``, { meta: { field: idOp.field } });\n\t}\n\t#compile() {\n\t\tconst model = this.#modelWithVariantFields();\n\t\tif (!model) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model: \"${this.#modelName}\".`, { meta: { model: this.#modelName } });\n\t\treturn compileMongoQuery(this.#collectionName, this.#state, this.#contract.storage.storageHash, model, this.#valueObjects());\n\t}\n\t#wrapCommand(command, resultShape) {\n\t\treturn {\n\t\t\tcollection: this.#collectionName,\n\t\t\tcommand,\n\t\t\tmeta: this.#planMeta(),\n\t\t\t...ifDefined(\"resultShape\", resultShape)\n\t\t};\n\t}\n\t#executePlan(command) {\n\t\treturn this.#executor.execute(this.#wrapCommand(command));\n\t}\n\tasync #drainPlan(command, resultShape) {\n\t\tconst plan = this.#wrapCommand(command, resultShape);\n\t\tconst result = this.#executor.query(plan);\n\t\tconst rows = [];\n\t\tfor await (const row of result) rows.push(row);\n\t\treturn rows;\n\t}\n\t#modelFields() {\n\t\treturn this.#modelWithVariantFields()?.fields ?? {};\n\t}\n\t#modelWithVariantFields() {\n\t\tconst models = mongoModelsOf(this.#contract.domain, defaultMongoDomainNamespaceId);\n\t\tconst model = models[this.#modelName];\n\t\tconst variantRef = this.#variantValue === void 0 ? void 0 : model?.variants?.[this.#variantValue];\n\t\tif (model === void 0 || variantRef === void 0) return model;\n\t\tconst variant = models[variantRef.model];\n\t\treturn variant === void 0 ? model : {\n\t\t\t...model,\n\t\t\tfields: {\n\t\t\t\t...model.fields,\n\t\t\t\t...variant.fields\n\t\t\t},\n\t\t\tstorage: {\n\t\t\t\t...model.storage,\n\t\t\t\tfields: {\n\t\t\t\t\t...model.storage.fields,\n\t\t\t\t\t...variant.storage.fields\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\t#idFieldShape() {\n\t\tconst model = this.#modelWithVariantFields();\n\t\tconst idField = model === void 0 ? void 0 : ownDocumentIdFieldOf(model)?.field;\n\t\treturn idField ? contractFieldToMongoFieldShape(idField) : Object.freeze({ kind: \"unknown\" });\n\t}\n\t#insertOneResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: {\n\t\t\t\tinsertedId: this.#idFieldShape(),\n\t\t\t\tdocument: this.#documentShape()\n\t\t\t}\n\t\t});\n\t}\n\t#insertManyResultShape() {\n\t\treturn freezeMongoResultShape({\n\t\t\tkind: \"document\",\n\t\t\tfields: {\n\t\t\t\tinsertedIds: {\n\t\t\t\t\tkind: \"array\",\n\t\t\t\t\tnullable: false,\n\t\t\t\t\telement: this.#idFieldShape()\n\t\t\t\t},\n\t\t\t\tdocuments: {\n\t\t\t\t\tkind: \"array\",\n\t\t\t\t\tnullable: false,\n\t\t\t\t\telement: this.#documentShape()\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\t#documentShape() {\n\t\tconst shape = this.#modelResultShape();\n\t\treturn shape.kind === \"document\" ? {\n\t\t\tkind: \"document\",\n\t\t\tnullable: false,\n\t\t\tfields: shape.fields,\n\t\t\trow: true\n\t\t} : { kind: \"unknown\" };\n\t}\n\t#modelResultShape() {\n\t\tconst model = this.#modelWithVariantFields();\n\t\tif (!model) return Object.freeze({ kind: \"unknown\" });\n\t\treturn contractModelToMongoResultShape(model, { valueObjects: this.#valueObjects() });\n\t}\n\t#valueObjects() {\n\t\treturn domainValueObjectsAtDefaultNamespace(this.#contract.domain) ?? {};\n\t}\n\t#compileWhereObject(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst filters = [];\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst storedName = storedNameOfCallerField(this.#storedNames(), key);\n\t\t\tconst field = fields[key];\n\t\t\tfilters.push(whereEquality(storedName, field, this.#wrapFieldValue(value, field, key, \"filter\")));\n\t\t}\n\t\treturn filters;\n\t}\n\t/**\n\t* Encodes the comparison values of a filter on a scalar field through the field's codec, as the object form of `where` and every update does. Without it a driver class such as an `ObjectId` would be copied into a plain object and match nothing.\n\t*/\n\t#encodeFieldFilter(filter) {\n\t\tconst storedPath = this.#storedPath(filter.field);\n\t\tconst field = this.#fieldAtPath(filter.field);\n\t\tif (field?.type.kind !== \"scalar\") return storedPath === filter.field ? filter : MongoFieldFilter.of(storedPath, filter.op, filter.value);\n\t\tconst encode = (value) => {\n\t\t\tif (value === null) return null;\n\t\t\tif (value instanceof MongoParamRef) return value.codecId === void 0 ? this.#wrapFieldValue(value.value, field, filter.field, \"filter\") : value;\n\t\t\tif (field.many && Array.isArray(value)) return value.map(encode);\n\t\t\treturn this.#wrapFieldValue(value, field, filter.field, \"filter\");\n\t\t};\n\t\tif (COMPARISON_OPERATORS.has(filter.op)) return MongoFieldFilter.of(storedPath, filter.op, encode(filter.value));\n\t\tif (MEMBERSHIP_OPERATORS.has(filter.op) && Array.isArray(filter.value)) {\n\t\t\tconst values = filter.value;\n\t\t\tconst encoded = values.map(encode);\n\t\t\treturn encoded.every((value, index) => value === values[index]) && storedPath === filter.field ? filter : MongoFieldFilter.of(storedPath, filter.op, encoded);\n\t\t}\n\t\treturn storedPath === filter.field ? filter : MongoFieldFilter.of(storedPath, filter.op, filter.value);\n\t}\n\t#fieldAtPath(path) {\n\t\tconst [head, ...rest] = path.split(\".\");\n\t\tlet field = head === void 0 ? void 0 : this.#modelFields()[head];\n\t\tfor (const segment of rest) {\n\t\t\tif (field?.type.kind !== \"valueObject\") return void 0;\n\t\t\tfield = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[field.type.name]?.fields[segment];\n\t\t}\n\t\treturn field;\n\t}\n\t/**\n\t* A value written to a field is checked against the field's enum and must not be `null` unless the field is nullable; a value compared in a filter is not, so a filter can find stored values the contract does not allow.\n\t*/\n\t#wrapFieldValue(value, field, path, purpose) {\n\t\tif (field === void 0) return new MongoParamRef(value);\n\t\tif (value === null) return this.#nullParam(field, path, purpose);\n\t\tif (field.type.kind === \"scalar\") {\n\t\t\tif (purpose === \"write\") this.#assertEnumValues(field, value, path);\n\t\t\treturn this.#scalarParam(value, field, path, purpose);\n\t\t}\n\t\tif (field.type.kind === \"valueObject\") {\n\t\t\tconst voName = field.type.name;\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[voName];\n\t\t\tif (!voDef) return new MongoParamRef(value);\n\t\t\tif (field.many && Array.isArray(value)) return value.map((item, index) => item === null ? null : this.#wrapValueObject(blindCast(item), voDef, `${path}.${index}`, purpose));\n\t\t\treturn this.#wrapValueObject(blindCast(value), voDef, path, purpose);\n\t\t}\n\t\treturn new MongoParamRef(value);\n\t}\n\t#nullParam(field, path, purpose) {\n\t\tif (purpose === \"write\" && !field.nullable) throw runtimeError(\"RUNTIME.ENCODE_FAILED\", `Failed to encode field ${path} in collection '${this.#collectionName}': the field is required and cannot be null`, {\n\t\t\tlabel: path,\n\t\t\tcollection: this.#collectionName\n\t\t});\n\t\treturn null;\n\t}\n\t/**\n\t* A contract without a collection validator (TypeScript builder, Prisma 6 schema) stores whatever reaches the driver, so a value outside the field's enum is refused here.\n\t*/\n\t#assertEnumValues(field, value, path) {\n\t\tconst valueSet = field.valueSet;\n\t\tif (valueSet === void 0 || valueSet.entityKind !== \"enum\" || value === null) return;\n\t\tconst contractEnum = this.#contract.domain.namespaces[valueSet.namespaceId]?.enum?.[valueSet.entityName];\n\t\tif (contractEnum === void 0) return;\n\t\tconst accessor = this.#enums[valueSet.namespaceId]?.[valueSet.entityName];\n\t\tif (accessor === void 0) throw ormError(\"ORM.ARGUMENT_INVALID\", `The ORM has no accessor for enum ${valueSet.entityName}, so it cannot check the value written to ${path} in collection '${this.#collectionName}'. Pass the contract's enum accessors: enums: buildMongoEnums(contract, context.codecs).`, { meta: {\n\t\t\targument: \"enums\",\n\t\t\tenum: valueSet.entityName\n\t\t} });\n\t\tconst values = field.many && Array.isArray(value) ? value : [value];\n\t\tconst outside = values.findIndex((entry) => entry !== null && !accessor.has(entry));\n\t\tif (outside === -1) return;\n\t\tconst received = values[outside];\n\t\tconst described = accessor.values.map(describeValue);\n\t\tconst list = described.length > 1 ? `${described.slice(0, -1).join(\", \")} and ${described.at(-1)}` : described.join(\"\");\n\t\tthrow runtimeError(\"RUNTIME.ENCODE_FAILED\", `Failed to encode field ${path} in collection '${this.#collectionName}': ${describeValue(received)} is not a value of enum ${valueSet.entityName}; the values are ${list}`, {\n\t\t\tlabel: path,\n\t\t\tcollection: this.#collectionName,\n\t\t\treceived,\n\t\t\tallowed: contractEnum.members.map((member) => member.value)\n\t\t});\n\t}\n\t/**\n\t* A scalar field's value as parameters: a list field's array is encoded element by element through the element codec, so the codec never sees the whole list.\n\t*/\n\t#scalarParam(value, field, path, purpose) {\n\t\tif (field.type.kind !== \"scalar\") return new MongoParamRef(value);\n\t\tconst codecId = field.type.codecId;\n\t\tif (field.many && Array.isArray(value)) {\n\t\t\tconst acceptsNull = field.many.elementNullable || purpose === \"filter\";\n\t\t\treturn value.map((element, index) => element === null && acceptsNull ? null : this.#fieldParam(element, codecId, `${path}.${index}`));\n\t\t}\n\t\treturn this.#fieldParam(value, codecId, path);\n\t}\n\t#fieldParam(value, codecId, path) {\n\t\treturn new MongoParamRef(value, {\n\t\t\tcodecId,\n\t\t\tname: path,\n\t\t\tcollection: this.#collectionName\n\t\t});\n\t}\n\t#wrapValueObject(data, voDef, path, purpose) {\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst fieldDef = voDef.fields[key];\n\t\t\tdoc[key] = this.#wrapFieldValue(value, fieldDef, `${path}.${key}`, purpose);\n\t\t}\n\t\treturn doc;\n\t}\n\t#toDocument(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst storage = this.#storedNames();\n\t\tconst doc = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst embedStoredName = Object.hasOwn(storage.embedStoredNames, key) ? storage.embedStoredNames[key] : void 0;\n\t\t\tif (embedStoredName !== void 0) {\n\t\t\t\tconst embedded = storage.embedded(key);\n\t\t\t\tdoc[embedStoredName] = new MongoParamRef(embedded === void 0 ? value : mapEach(value, (row) => storedDocumentOfRow(row, embedded)));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdoc[storedNameOfCallerField(storage, key)] = this.#wrapFieldValue(value, fields[key], key, \"write\");\n\t\t}\n\t\treturn doc;\n\t}\n\t#toSetFields(data) {\n\t\tconst fields = this.#modelFields();\n\t\tconst storage = this.#storedNames();\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) {\n\t\t\tif (value === void 0) continue;\n\t\t\tconst storedName = storedPathOfCallerPath(storage, key);\n\t\t\tif (storedName === \"_id\") throw ormError(\"ORM.FIELD_IMMUTABLE\", `Mutation payloads cannot modify \\`${key}\\``, { meta: { field: key } });\n\t\t\tconst isEmbed = Object.hasOwn(storage.embedStoredNames, key);\n\t\t\tconst embedded = isEmbed ? storage.embedded(key) : void 0;\n\t\t\tresult[storedName] = !isEmbed ? this.#wrapFieldValue(value, fields[key], key, \"write\") : new MongoParamRef(embedded === void 0 ? value : mapEach(value, (row) => storedDocumentOfRow(row, embedded)));\n\t\t}\n\t\treturn result;\n\t}\n\t/** The defaults generated for a document whose stored names are the keys of `storedValues`, keyed by field name. A default of the collection for a stored name this model does not store belongs to another model stored in the collection, and is left out. */\n\t#appliedDefaults(op, storedValues, defaultValueCache) {\n\t\tconst applied = this.#mutationDefaults?.applyMutationDefaults({\n\t\t\top,\n\t\t\tnamespace: UNBOUND_NAMESPACE_ID,\n\t\t\tentry: this.#collectionName,\n\t\t\tvalues: storedValues,\n\t\t\tdefaultValueCache\n\t\t}) ?? [];\n\t\tconst { fieldNames } = this.#storedNames();\n\t\treturn Object.fromEntries(applied.flatMap(({ field: storedName, value }) => {\n\t\t\tconst fieldName = Object.hasOwn(fieldNames, storedName) ? fieldNames[storedName] : void 0;\n\t\t\treturn fieldName === void 0 ? [] : [[fieldName, value]];\n\t\t}));\n\t}\n\t#withCreateDefaults(values, defaultValueCache) {\n\t\treturn {\n\t\t\t...values,\n\t\t\t...this.#appliedDefaults(\"create\", this.#storedKeys(values), defaultValueCache)\n\t\t};\n\t}\n\t#withUpdateDefaults(updateDoc, defaultValueCache) {\n\t\tconst explicit = Object.fromEntries([...topLevelUpdateFields(updateDoc)].map((field) => [field, true]));\n\t\tconst generated = this.#appliedDefaults(\"update\", explicit, defaultValueCache);\n\t\tif (Object.keys(generated).length === 0) return updateDoc;\n\t\treturn {\n\t\t\t...updateDoc,\n\t\t\t$set: {\n\t\t\t\t...updateDoc[\"$set\"],\n\t\t\t\t...this.#toSetFields(generated)\n\t\t\t}\n\t\t};\n\t}\n\t#stripUndefined(data) {\n\t\tconst result = {};\n\t\tfor (const [key, value] of Object.entries(data)) if (value !== void 0) result[key] = value;\n\t\treturn result;\n\t}\n\t#toUpdateDocument(data) {\n\t\treturn { $set: this.#toSetFields(data) };\n\t}\n\t#resolveUpdateDoc(dataOrCallback) {\n\t\tif (typeof dataOrCallback === \"function\") {\n\t\t\tconst ops = dataOrCallback(createFieldAccessor());\n\t\t\tthis.#rejectDocumentIdOps(ops);\n\t\t\tif (ops.length === 0) return { $set: {} };\n\t\t\treturn compileFieldOperations(ops, (field, value, operator) => this.#wrapFieldOpValue(field, value, operator), (field) => this.#storedPath(field));\n\t\t}\n\t\treturn this.#toUpdateDocument(blindCast(dataOrCallback));\n\t}\n\t/**\n\t* `$set` carries the field's whole value; `$push`, `$addToSet`, `$pull`, `$inc` and `$mul` carry one element or number; `$pop` and `$unset` carry no field value and are not encoded.\n\t*/\n\t#wrapFieldOpValue(path, value, operator) {\n\t\tif (operator === \"$unset\" || operator === \"$pop\" || !(value instanceof MongoParamRef)) return value;\n\t\tconst field = this.#fieldAtPath(path);\n\t\tif (field === void 0) return value;\n\t\tif (operator === \"$set\") return this.#wrapFieldValue(value.value, field, path, \"write\");\n\t\tif (value.value === null && field.many && (field.many.elementNullable || operator === \"$pull\")) return null;\n\t\tif (operator === \"$pull\") return this.#wrapFieldValue(value.value, field, path, \"filter\");\n\t\tif (field.type.kind === \"scalar\") {\n\t\t\tthis.#assertEnumValues(field, field.many ? [value.value] : value.value, path);\n\t\t\treturn this.#fieldParam(value.value, field.type.codecId, path);\n\t\t}\n\t\tif (field.type.kind === \"valueObject\" && isUnknownRecord(value.value)) {\n\t\t\tconst voDef = domainValueObjectsAtDefaultNamespace(this.#contract.domain)?.[field.type.name];\n\t\t\tif (voDef) return this.#wrapValueObject(value.value, voDef, path, \"write\");\n\t\t}\n\t\treturn value;\n\t}\n\t#mergeFilters() {\n\t\tconst [single] = this.#state.filters;\n\t\tif (this.#state.filters.length === 1 && single) return single;\n\t\treturn MongoAndExpr.of([...this.#state.filters]);\n\t}\n\t#requireFilters(methodName) {\n\t\tif (this.#state.filters.length === 0) throw ormError(\"ORM.WHERE_MISSING\", `${methodName}() requires a .where() filter. Call .where() before .${methodName}()`, { meta: { method: methodName } });\n\t}\n\t#rejectWindowing(methodName) {\n\t\tif (this.#state.orderBy !== void 0 || this.#state.limit !== void 0 || this.#state.offset !== void 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support orderBy/offset/limit. Remove windowing before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"windowing\"\n\t\t} });\n\t}\n\t#rejectIncludes(methodName) {\n\t\tif (this.#state.includes.length > 0) throw ormError(\"ORM.OPERATION_UNSUPPORTED\", `${methodName}() does not support .include(). Remove includes before calling .${methodName}()`, { meta: {\n\t\t\tmethod: methodName,\n\t\t\treason: \"includes\"\n\t\t} });\n\t}\n\t#planMeta() {\n\t\treturn {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: this.#contract.storage.storageHash,\n\t\t\tlane: \"mongo-orm\"\n\t\t};\n\t}\n\t#injectDiscriminator(data) {\n\t\tif (!this.#variantValue) return data;\n\t\tconst model = mongoModelsOf(this.#contract.domain, defaultMongoDomainNamespaceId)[this.#modelName];\n\t\tif (!model?.discriminator) return data;\n\t\treturn {\n\t\t\t...data,\n\t\t\t[model.discriminator.field]: this.#variantValue\n\t\t};\n\t}\n\t#clone(overrides) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor, this.#mutationDefaults, this.#enums);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantValue = this.#variantValue;\n\t\treturn instance;\n\t}\n\t#cloneWithVariant(overrides, variantValue) {\n\t\tconst instance = new MongoCollectionImpl(this.#contract, this.#modelName, this.#executor, this.#mutationDefaults, this.#enums);\n\t\tinstance.#state = {\n\t\t\t...this.#state,\n\t\t\t...overrides\n\t\t};\n\t\tinstance.#collectionName = this.#collectionName;\n\t\tinstance.#variantValue = variantValue;\n\t\treturn instance;\n\t}\n};\nfunction createMongoCollection(contract, modelName, executor, enums, mutationDefaults) {\n\treturn new MongoCollectionImpl(contract, modelName, executor, mutationDefaults, enums);\n}\n//#endregion\n//#region src/mongo-orm.ts\nfunction assertEnumsComplete(contract, enums) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst accessors = enums[namespaceId] ?? {};\n\t\tfor (const enumName of Object.keys(namespace.enum ?? {})) {\n\t\t\tif (enumName in accessors) continue;\n\t\t\tthrow ormError(\"ORM.ARGUMENT_INVALID\", `mongoOrm() has no accessor for enum ${enumName} in namespace ${namespaceId}, so it cannot check a value written to a field of that enum. Pass the contract's enum accessors: enums: buildMongoEnums(contract, context.codecs).`, { meta: {\n\t\t\t\targument: \"enums\",\n\t\t\t\tnamespace: namespaceId,\n\t\t\t\tenum: enumName\n\t\t\t} });\n\t\t}\n\t}\n}\nfunction mongoOrm(options) {\n\tconst { contract, executor, mutationDefaults, enums } = options;\n\tconst executionDefaults = contract.execution?.mutations.defaults ?? [];\n\tif (executionDefaults.length > 0 && mutationDefaults === void 0) throw ormError(\"ORM.MUTATION_DEFAULTS_MISSING\", \"The contract has execution defaults (fields such as temporal.createdAt() that the ORM fills on write), but mongoOrm() was built without mutationDefaults, so those fields would never be written. Pass the execution context: mongoOrm({ contract, executor, mutationDefaults: context }), or create the client with mongo().\", { meta: { fields: executionDefaults.map((d) => `${d.ref.entry}.${d.ref.field}`) } });\n\tassertEnumsComplete(contract, enums);\n\tconst client = {};\n\tfor (const [rootName, rootRef] of Object.entries(contract.roots)) client[rootName] = createMongoCollection(contract, blindCast(rootRef.model), executor, enums, mutationDefaults);\n\treturn blindCast(client);\n}\n//#endregion\n//#region src/raw-collection.ts\nfunction createRawMongoCollection(collectionName, meta) {\n\tfunction buildable(command) {\n\t\treturn { build: () => ({\n\t\t\tcollection: collectionName,\n\t\t\tcommand,\n\t\t\tmeta\n\t\t}) };\n\t}\n\treturn {\n\t\taggregate(pipeline) {\n\t\t\treturn buildable(new RawAggregateCommand(collectionName, pipeline));\n\t\t},\n\t\tinsertOne(document) {\n\t\t\treturn buildable(new RawInsertOneCommand(collectionName, document));\n\t\t},\n\t\tinsertMany(documents) {\n\t\t\treturn buildable(new RawInsertManyCommand(collectionName, documents));\n\t\t},\n\t\tupdateOne(filter, update) {\n\t\t\treturn buildable(new RawUpdateOneCommand(collectionName, filter, update));\n\t\t},\n\t\tupdateMany(filter, update) {\n\t\t\treturn buildable(new RawUpdateManyCommand(collectionName, filter, update));\n\t\t},\n\t\tdeleteOne(filter) {\n\t\t\treturn buildable(new RawDeleteOneCommand(collectionName, filter));\n\t\t},\n\t\tdeleteMany(filter) {\n\t\t\treturn buildable(new RawDeleteManyCommand(collectionName, filter));\n\t\t},\n\t\tfindOneAndUpdate(filter, update, options) {\n\t\t\treturn buildable(new RawFindOneAndUpdateCommand(collectionName, filter, update, options?.upsert ?? false));\n\t\t},\n\t\tfindOneAndDelete(filter) {\n\t\t\treturn buildable(new RawFindOneAndDeleteCommand(collectionName, filter));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/mongo-raw.ts\nfunction mongoRaw(options) {\n\tconst { contract } = options;\n\treturn { collection(rootName) {\n\t\tconst modelName = contract.roots[rootName]?.model;\n\t\tconst models = mongoModelsOf(contract.domain, defaultMongoDomainNamespaceId);\n\t\tif (!modelName || !Object.hasOwn(models, modelName)) throw ormError(\"ORM.MODEL_UNKNOWN\", `Unknown model \"${modelName ?? \"\"}\" for root \"${rootName}\"`, { meta: {\n\t\t\tmodel: modelName ?? \"\",\n\t\t\troot: rootName\n\t\t} });\n\t\treturn createRawMongoCollection(models[modelName]?.storage.collection ?? modelName, {\n\t\t\ttarget: \"mongo\",\n\t\t\tstorageHash: contract.storage.storageHash,\n\t\t\tlane: \"mongo-raw\"\n\t\t});\n\t} };\n}\n//#endregion\nexport { compileMongoQuery, createFieldAccessor, createMongoCollection, mongoOrm, mongoRaw };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;AAYA,SAAS,uBAAuB;CAC/B,OAAO;EACN,SAAS,CAAC;EACV,UAAU,CAAC;EACX,SAAS,KAAK;EACd,gBAAgB,KAAK;EACrB,OAAO,KAAK;EACZ,QAAQ,KAAK;CACd;AACD;AAGA,SAAS,QAAQ,SAAS;CACzB,OAAO,QAAQ,gBAAgB,SAAS,QAAQ,gBAAgB;AACjE;;;;AAIA,SAAS,aAAa,SAAS,cAAc;CAC5C,MAAM,SAAS,gCAAgC,QAAQ,aAAa,EAAE,aAAa,C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AO,aAAa;GACpB,MAAM;EACP,EAAE,CAAC;EACH,OAAO,yBAAyB,OAAO,UAAU,EAAE,QAAQ,cAAc,WAAW;GACnF,QAAQ;GACR,aAAa,SAAS,QAAQ;GAC9B,MAAM;EACP,CAAC;CACF,EAAE;AACH"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import "@prisma/orm-framework/components/ir";
|
|
2
|
+
import "@prisma/orm-framework/contract-authoring";
|
|
3
|
+
import { AuthoringAttributeSpecContributions, AuthoringEntityTypeNamespace } from "@prisma/orm-framework/components/authoring";
|
|
4
|
+
import "@prisma/orm-framework/psl-parser";
|
|
5
|
+
import "@prisma/orm-framework/components/components";
|
|
6
|
+
//#region ../../../2-mongo-family/9-family/dist/pack.d.mts
|
|
7
|
+
//#region src/core/authoring-entity-types.d.ts
|
|
8
|
+
declare function mongoFamilyEnumSpec(): import("@prisma/orm-framework/psl-parser").MapBlockSpec<Record<string, string | number | boolean | import("@prisma/orm-framework/components/authoring").WrittenScalar | (string | number | boolean | import("@prisma/orm-framework/components/authoring").WrittenScalar)[] | undefined>>;
|
|
9
|
+
declare const mongoFamilyEntityTypes: AuthoringEntityTypeNamespace;
|
|
10
|
+
declare const mongoFamilyPslBlockDescriptors: {
|
|
11
|
+
readonly enum: {
|
|
12
|
+
kind: "pslBlock";
|
|
13
|
+
keyword: string;
|
|
14
|
+
documentation: string;
|
|
15
|
+
discriminator: string;
|
|
16
|
+
name: {
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
spec: typeof mongoFamilyEnumSpec;
|
|
20
|
+
attributes: {
|
|
21
|
+
type: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
22
|
+
codecId: string;
|
|
23
|
+
}, import("@prisma/orm-framework/psl-parser").BlockAttributeCtx>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/exports/pack.d.ts
|
|
29
|
+
declare const mongoFamilyPack: {
|
|
30
|
+
readonly kind: "family";
|
|
31
|
+
readonly id: "mongo";
|
|
32
|
+
readonly familyId: "mongo";
|
|
33
|
+
readonly version: "0.0.1";
|
|
34
|
+
readonly authoring: {
|
|
35
|
+
readonly entityTypes: import("@prisma/orm-framework/components/authoring").AuthoringEntityTypeNamespace;
|
|
36
|
+
readonly pslBlockDescriptors: {
|
|
37
|
+
readonly enum: {
|
|
38
|
+
kind: "pslBlock";
|
|
39
|
+
keyword: string;
|
|
40
|
+
documentation: string;
|
|
41
|
+
discriminator: string;
|
|
42
|
+
name: {
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
spec: typeof mongoFamilyEnumSpec;
|
|
46
|
+
attributes: {
|
|
47
|
+
type: () => import("@prisma/orm-framework/psl-parser").AttributeSpec<{
|
|
48
|
+
codecId: string;
|
|
49
|
+
}, import("@prisma/orm-framework/psl-parser").BlockAttributeCtx>;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly attributeSpecs: AuthoringAttributeSpecContributions;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { mongoFamilyPack as n, mongoFamilyPslBlockDescriptors as r, mongoFamilyEntityTypes as t };
|
|
58
|
+
//# sourceMappingURL=pack-qw77Jt2G.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-qw77Jt2G.d.mts","names":[],"sources":["../../../../2-mongo-family/9-family/dist/pack.d.mts"],"mappings":";;;;;;;iBASiB,sDAAsD,aAAa,8FAA8F,gGAAgG;cACpQ,wBAAwB;cACxB;WACH;IACP;IACA;IACA;IACA;IACA;MACE;;IAEF,aAAa;IACb;MACE,2CAA2C;QACzC;wCACgC;;;;;;cAM1B;WACH;WACA;WACA;WACA;WACA;aACE,gEAAgE;aAChE;eACE;QACP;QACA;QACA;QACA;QACA;UACE;;QAEF,aAAa;QACb;UACE,2CAA2C;YACzC;4CACgC;;;;aAI/B,gBAAgB"}
|
package/dist/query-ast.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-
|
|
2
|
-
import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-
|
|
3
|
-
import { C as
|
|
4
|
-
import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-
|
|
5
|
-
export { type AggRecordArgs, AggregateCommand, type AnyMongoCommand, type AnyMongoDdlCommand, type AnyMongoInspectionCommand, type AnyMongoMigrationOperation, CollModCommand, type CollModOptions, CreateCollectionCommand, type CreateCollectionOptions, CreateIndexCommand, type CreateIndexOptions, DeleteManyCommand, type DeleteManyResult, DeleteOneCommand, type DeleteOneResult, type DeleteResult, DropCollectionCommand, DropIndexCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, type InsertManyResult, InsertOneCommand, type InsertOneResult, ListCollectionsCommand, ListIndexesCommand, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, type MongoAggExpr, type MongoAggExprRewriter, type MongoAggExprVisitor, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, type MongoAggSwitchBranch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, type
|
|
1
|
+
import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-DEd7WLCT-B2Ar2GkJ.mjs";
|
|
2
|
+
import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-3fs1HokF-CrNsr-Wx.mjs";
|
|
3
|
+
import { C as defaultMongoIndexName, S as buildIndexOpId, T as keysToKeySpec, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDmlOperation, h as MongoDmlCheck, i as CollModCommand, l as CreateIndexOptions, m as MongoDdlCommandVisitor, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, w as isMongoDmlOperation, x as RenameCollectionCommand, y as MongoMigrationPlanOperation } from "./control-4pC8N2Rb.mjs";
|
|
4
|
+
import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-tPmN5pge.mjs";
|
|
5
|
+
export { type AggRecordArgs, AggregateCommand, type AnyMongoCommand, type AnyMongoDdlCommand, type AnyMongoInspectionCommand, type AnyMongoMigrationOperation, CollModCommand, type CollModOptions, CreateCollectionCommand, type CreateCollectionOptions, CreateIndexCommand, type CreateIndexOptions, DeleteManyCommand, type DeleteManyResult, DeleteOneCommand, type DeleteOneResult, type DeleteResult, DropCollectionCommand, DropIndexCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, type InsertManyResult, InsertOneCommand, type InsertOneResult, ListCollectionsCommand, ListIndexesCommand, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, type MongoAggExpr, type MongoAggExprRewriter, type MongoAggExprVisitor, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, type MongoAggSwitchBranch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, type MongoDdlCommandVisitor, type MongoDensifyRange, MongoDensifyStage, type MongoDmlCheck, type MongoDmlOperation, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, type MongoFieldShape, type MongoFillOutput, MongoFillStage, type MongoFilterExpr, type MongoFilterRewriter, type MongoFilterVisitor, MongoGeoNearStage, MongoGraphLookupStage, type MongoGroupId, MongoGroupStage, type MongoIndexKey, type MongoIndexKeyDirection, type MongoInspectionCommandVisitor, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, type MongoMigrationCheck, type MongoMigrationPlanOperation, type MongoMigrationStep, MongoNotExpr, MongoOrExpr, MongoOutStage, type MongoPipelineStage, MongoProjectStage, type MongoProjectionValue, type MongoQueryPlan, MongoRedactStage, MongoReplaceRootStage, type MongoResultShape, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, type MongoStageRewriterContext, type MongoStageVisitor, MongoUnionWithStage, MongoUnwindStage, type MongoUpdatePipelineStage, type MongoUpdateSpec, MongoVectorSearchStage, type MongoWindowField, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, type RawMongoCommand, RawUpdateManyCommand, RawUpdateOneCommand, RenameCollectionCommand, UpdateManyCommand, type UpdateManyResult, UpdateOneCommand, type UpdateOneResult, type UpdateResult, buildIndexOpId, defaultMongoIndexName, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoDmlOperation, isMongoFilterExpr, isRecordArgs, keysToKeySpec };
|
package/dist/query-ast.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as MongoFieldFilter, c as isMongoFilterExpr, i as MongoExprFilter, o as MongoNotExpr, r as MongoExistsExpr, s as MongoOrExpr, t as MongoAndExpr } from "./filter-expressions-Uo8ZdzwB-53qnqceS.mjs";
|
|
2
|
-
import { $ as RawInsertOneCommand, A as MongoLookupStage, B as MongoSetWindowFieldsStage, C as MongoDensifyStage, D as MongoGraphLookupStage, E as MongoGeoNearStage, F as MongoRedactStage, G as MongoUnwindStage, H as MongoSortByCountStage, I as MongoReplaceRootStage, J as RawDeleteManyCommand, K as MongoVectorSearchStage, L as MongoSampleStage, M as MongoMergeStage, N as MongoOutStage, O as MongoGroupStage, P as MongoProjectStage, Q as RawInsertManyCommand, R as MongoSearchMetaStage, S as MongoCountStage, T as MongoFillStage, U as MongoSortStage, V as MongoSkipStage, W as MongoUnionWithStage, X as RawFindOneAndDeleteCommand, Y as RawDeleteOneCommand, Z as RawFindOneAndUpdateCommand, _ as MongoAggOperator, a as FindOneAndUpdateCommand, at as freezeMongoResultShape, b as MongoBucketAutoStage, c as MongoAddFieldsStage, d as MongoAggCond, et as RawUpdateManyCommand, f as MongoAggFieldRef, g as MongoAggMergeObjects, h as MongoAggMap, i as FindOneAndDeleteCommand, it as freezeMongoFieldShape, j as MongoMatchStage, k as MongoLimitStage, l as MongoAggAccumulator, m as MongoAggLiteral, n as DeleteManyCommand, nt as UpdateManyCommand, o as InsertManyCommand, ot as isExprArray, p as MongoAggLet, q as RawAggregateCommand, r as DeleteOneCommand, rt as UpdateOneCommand, s as InsertOneCommand, st as isRecordArgs, t as AggregateCommand, tt as RawUpdateOneCommand, u as MongoAggArrayFilter, v as MongoAggReduce, w as MongoFacetStage, x as MongoBucketStage, y as MongoAggSwitch, z as MongoSearchStage } from "./execution-
|
|
3
|
-
import { a as DropIndexCommand, c as
|
|
4
|
-
export { AggregateCommand, CollModCommand, CreateCollectionCommand, CreateIndexCommand, DeleteManyCommand, DeleteOneCommand, DropCollectionCommand, DropIndexCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, InsertOneCommand, ListCollectionsCommand, ListIndexesCommand, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, MongoDensifyStage, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, MongoFillStage, MongoGeoNearStage, MongoGraphLookupStage, MongoGroupStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoNotExpr, MongoOrExpr, MongoOutStage, MongoProjectStage, MongoRedactStage, MongoReplaceRootStage, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, MongoUnionWithStage, MongoUnwindStage, MongoVectorSearchStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, UpdateOneCommand, buildIndexOpId, defaultMongoIndexName, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoFilterExpr, isRecordArgs, keysToKeySpec };
|
|
2
|
+
import { $ as RawInsertOneCommand, A as MongoLookupStage, B as MongoSetWindowFieldsStage, C as MongoDensifyStage, D as MongoGraphLookupStage, E as MongoGeoNearStage, F as MongoRedactStage, G as MongoUnwindStage, H as MongoSortByCountStage, I as MongoReplaceRootStage, J as RawDeleteManyCommand, K as MongoVectorSearchStage, L as MongoSampleStage, M as MongoMergeStage, N as MongoOutStage, O as MongoGroupStage, P as MongoProjectStage, Q as RawInsertManyCommand, R as MongoSearchMetaStage, S as MongoCountStage, T as MongoFillStage, U as MongoSortStage, V as MongoSkipStage, W as MongoUnionWithStage, X as RawFindOneAndDeleteCommand, Y as RawDeleteOneCommand, Z as RawFindOneAndUpdateCommand, _ as MongoAggOperator, a as FindOneAndUpdateCommand, at as freezeMongoResultShape, b as MongoBucketAutoStage, c as MongoAddFieldsStage, d as MongoAggCond, et as RawUpdateManyCommand, f as MongoAggFieldRef, g as MongoAggMergeObjects, h as MongoAggMap, i as FindOneAndDeleteCommand, it as freezeMongoFieldShape, j as MongoMatchStage, k as MongoLimitStage, l as MongoAggAccumulator, m as MongoAggLiteral, n as DeleteManyCommand, nt as UpdateManyCommand, o as InsertManyCommand, ot as isExprArray, p as MongoAggLet, q as RawAggregateCommand, r as DeleteOneCommand, rt as UpdateOneCommand, s as InsertOneCommand, st as isRecordArgs, t as AggregateCommand, tt as RawUpdateOneCommand, u as MongoAggArrayFilter, v as MongoAggReduce, w as MongoFacetStage, x as MongoBucketStage, y as MongoAggSwitch, z as MongoSearchStage } from "./execution-CgP1Sdbr.mjs";
|
|
3
|
+
import { a as DropIndexCommand, c as RenameCollectionCommand, d as isMongoDmlOperation, f as keysToKeySpec, i as DropCollectionCommand, l as buildIndexOpId, n as CreateCollectionCommand, o as ListCollectionsCommand, r as CreateIndexCommand, s as ListIndexesCommand, t as CollModCommand, u as defaultMongoIndexName } from "./control-BQMBG11d.mjs";
|
|
4
|
+
export { AggregateCommand, CollModCommand, CreateCollectionCommand, CreateIndexCommand, DeleteManyCommand, DeleteOneCommand, DropCollectionCommand, DropIndexCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, InsertOneCommand, ListCollectionsCommand, ListIndexesCommand, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, MongoDensifyStage, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, MongoFillStage, MongoGeoNearStage, MongoGraphLookupStage, MongoGroupStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoNotExpr, MongoOrExpr, MongoOutStage, MongoProjectStage, MongoRedactStage, MongoReplaceRootStage, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, MongoUnionWithStage, MongoUnwindStage, MongoVectorSearchStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand, RenameCollectionCommand, UpdateManyCommand, UpdateOneCommand, buildIndexOpId, defaultMongoIndexName, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoDmlOperation, isMongoFilterExpr, isRecordArgs, keysToKeySpec };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-
|
|
2
|
-
import { B as MongoFilterExpr, E as MongoAndExpr, H as MongoFilterVisitor, I as MongoFieldFilter, N as MongoExistsExpr, P as MongoExprFilter, Q as MongoOrExpr, Z as MongoNotExpr } from "./query-plan-
|
|
3
|
-
import { C as
|
|
4
|
-
export { type AnyMongoDdlCommand, type AnyMongoInspectionCommand, type AnyMongoMigrationOperation, CollModCommand, type CollModOptions, CreateCollectionCommand, type CreateCollectionOptions, CreateIndexCommand, type CreateIndexOptions, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, type
|
|
1
|
+
import { A as MongoIndexKey, j as MongoIndexKeyDirection } from "./mongo-value-set-DEd7WLCT-B2Ar2GkJ.mjs";
|
|
2
|
+
import { B as MongoFilterExpr, E as MongoAndExpr, H as MongoFilterVisitor, I as MongoFieldFilter, N as MongoExistsExpr, P as MongoExprFilter, Q as MongoOrExpr, Z as MongoNotExpr } from "./query-plan-3fs1HokF-CrNsr-Wx.mjs";
|
|
3
|
+
import { C as defaultMongoIndexName, S as buildIndexOpId, T as keysToKeySpec, _ as MongoInspectionCommandVisitor, a as CollModOptions, b as MongoMigrationStep, c as CreateIndexCommand, d as DropIndexCommand, f as ListCollectionsCommand, g as MongoDmlOperation, h as MongoDmlCheck, i as CollModCommand, l as CreateIndexOptions, m as MongoDdlCommandVisitor, n as AnyMongoInspectionCommand, o as CreateCollectionCommand, p as ListIndexesCommand, r as AnyMongoMigrationOperation, s as CreateCollectionOptions, t as AnyMongoDdlCommand, u as DropCollectionCommand, v as MongoMigrationCheck, w as isMongoDmlOperation, x as RenameCollectionCommand, y as MongoMigrationPlanOperation } from "./control-4pC8N2Rb.mjs";
|
|
4
|
+
export { type AnyMongoDdlCommand, type AnyMongoInspectionCommand, type AnyMongoMigrationOperation, CollModCommand, type CollModOptions, CreateCollectionCommand, type CreateCollectionOptions, CreateIndexCommand, type CreateIndexOptions, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, type MongoDdlCommandVisitor, type MongoDmlCheck, type MongoDmlOperation, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, type MongoFilterExpr, type MongoFilterVisitor, type MongoIndexKey, type MongoIndexKeyDirection, type MongoInspectionCommandVisitor, type MongoMigrationCheck, type MongoMigrationPlanOperation, type MongoMigrationStep, MongoNotExpr, MongoOrExpr, RenameCollectionCommand, buildIndexOpId, defaultMongoIndexName, isMongoDmlOperation, keysToKeySpec };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as MongoFieldFilter, i as MongoExprFilter, o as MongoNotExpr, r as MongoExistsExpr, s as MongoOrExpr, t as MongoAndExpr } from "./filter-expressions-Uo8ZdzwB-53qnqceS.mjs";
|
|
2
|
-
import { a as DropIndexCommand, c as
|
|
3
|
-
export { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, MongoNotExpr, MongoOrExpr, buildIndexOpId, defaultMongoIndexName, keysToKeySpec };
|
|
2
|
+
import { a as DropIndexCommand, c as RenameCollectionCommand, d as isMongoDmlOperation, f as keysToKeySpec, i as DropCollectionCommand, l as buildIndexOpId, n as CreateCollectionCommand, o as ListCollectionsCommand, r as CreateIndexCommand, s as ListIndexesCommand, t as CollModCommand, u as defaultMongoIndexName } from "./control-BQMBG11d.mjs";
|
|
3
|
+
export { CollModCommand, CreateCollectionCommand, CreateIndexCommand, DropCollectionCommand, DropIndexCommand, ListCollectionsCommand, ListIndexesCommand, MongoAndExpr, MongoExistsExpr, MongoExprFilter, MongoFieldFilter, MongoNotExpr, MongoOrExpr, RenameCollectionCommand, buildIndexOpId, defaultMongoIndexName, isMongoDmlOperation, keysToKeySpec };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-
|
|
2
|
-
import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-
|
|
1
|
+
import { $ as MongoOutStage, A as MongoCountStage, At as RawUpdateManyCommand, B as MongoFilterExpr, C as MongoAggReduce, Ct as RawDeleteManyCommand, Dt as RawInsertManyCommand, E as MongoAndExpr, Et as RawFindOneAndUpdateCommand, F as MongoFacetStage, Ft as freezeMongoResultShape, G as MongoGroupId, H as MongoFilterVisitor, I as MongoFieldFilter, It as isExprArray, J as MongoLookupStage, K as MongoGroupStage, L as MongoFieldShape, Lt as isMongoFilterExpr, M as MongoDensifyStage, Mt as UpdateManyCommand, N as MongoExistsExpr, Nt as UpdateOneCommand, O as MongoBucketAutoStage, Ot as RawInsertOneCommand, P as MongoExprFilter, Pt as freezeMongoFieldShape, Q as MongoOrExpr, R as MongoFillOutput, Rt as isRecordArgs, S as MongoAggOperator, St as RawAggregateCommand, T as MongoAggSwitchBranch, Tt as RawFindOneAndDeleteCommand, U as MongoGeoNearStage, V as MongoFilterRewriter, W as MongoGraphLookupStage, X as MongoMergeStage, Y as MongoMatchStage, Z as MongoNotExpr, _ as MongoAggFieldRef, _t as MongoUnwindStage, a as DeleteOneCommand, at as MongoReplaceRootStage, b as MongoAggMap, bt as MongoVectorSearchStage, c as InsertManyCommand, ct as MongoSearchMetaStage, d as MongoAggAccumulator, dt as MongoSkipStage, et as MongoPipelineStage, f as MongoAggArrayFilter, ft as MongoSortByCountStage, g as MongoAggExprVisitor, gt as MongoUnionWithStage, h as MongoAggExprRewriter, ht as MongoStageVisitor, i as DeleteManyCommand, it as MongoRedactStage, j as MongoDensifyRange, jt as RawUpdateOneCommand, k as MongoBucketStage, kt as RawMongoCommand, l as InsertOneCommand, lt as MongoSearchStage, m as MongoAggExpr, mt as MongoStageRewriterContext, n as AggregateCommand, nt as MongoProjectionValue, o as FindOneAndDeleteCommand, ot as MongoResultShape, p as MongoAggCond, pt as MongoSortStage, q as MongoLimitStage, r as AnyMongoCommand, rt as MongoQueryPlan, s as FindOneAndUpdateCommand, st as MongoSampleStage, t as AggRecordArgs, tt as MongoProjectStage, u as MongoAddFieldsStage, ut as MongoSetWindowFieldsStage, v as MongoAggLet, vt as MongoUpdatePipelineStage, w as MongoAggSwitch, wt as RawDeleteOneCommand, x as MongoAggMergeObjects, xt as MongoWindowField, y as MongoAggLiteral, yt as MongoUpdateSpec, z as MongoFillStage } from "./query-plan-3fs1HokF-CrNsr-Wx.mjs";
|
|
2
|
+
import { a as InsertOneResult, c as UpdateResult, i as InsertManyResult, n as DeleteOneResult, o as UpdateManyResult, r as DeleteResult, s as UpdateOneResult, t as DeleteManyResult } from "./execution-tPmN5pge.mjs";
|
|
3
3
|
export { type AggRecordArgs, AggregateCommand, type AnyMongoCommand, DeleteManyCommand, type DeleteManyResult, DeleteOneCommand, type DeleteOneResult, type DeleteResult, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, type InsertManyResult, InsertOneCommand, type InsertOneResult, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, type MongoAggExpr, type MongoAggExprRewriter, type MongoAggExprVisitor, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, type MongoAggSwitchBranch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, type MongoDensifyRange, MongoDensifyStage, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, type MongoFieldShape, type MongoFillOutput, MongoFillStage, type MongoFilterExpr, type MongoFilterRewriter, type MongoFilterVisitor, MongoGeoNearStage, MongoGraphLookupStage, type MongoGroupId, MongoGroupStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoNotExpr, MongoOrExpr, MongoOutStage, type MongoPipelineStage, MongoProjectStage, type MongoProjectionValue, type MongoQueryPlan, MongoRedactStage, MongoReplaceRootStage, type MongoResultShape, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, type MongoStageRewriterContext, type MongoStageVisitor, MongoUnionWithStage, MongoUnwindStage, type MongoUpdatePipelineStage, type MongoUpdateSpec, MongoVectorSearchStage, type MongoWindowField, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, type RawMongoCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, type UpdateManyResult, UpdateOneCommand, type UpdateOneResult, type UpdateResult, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoFilterExpr, isRecordArgs };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as MongoFieldFilter, c as isMongoFilterExpr, i as MongoExprFilter, o as MongoNotExpr, r as MongoExistsExpr, s as MongoOrExpr, t as MongoAndExpr } from "./filter-expressions-Uo8ZdzwB-53qnqceS.mjs";
|
|
2
|
-
import { $ as RawInsertOneCommand, A as MongoLookupStage, B as MongoSetWindowFieldsStage, C as MongoDensifyStage, D as MongoGraphLookupStage, E as MongoGeoNearStage, F as MongoRedactStage, G as MongoUnwindStage, H as MongoSortByCountStage, I as MongoReplaceRootStage, J as RawDeleteManyCommand, K as MongoVectorSearchStage, L as MongoSampleStage, M as MongoMergeStage, N as MongoOutStage, O as MongoGroupStage, P as MongoProjectStage, Q as RawInsertManyCommand, R as MongoSearchMetaStage, S as MongoCountStage, T as MongoFillStage, U as MongoSortStage, V as MongoSkipStage, W as MongoUnionWithStage, X as RawFindOneAndDeleteCommand, Y as RawDeleteOneCommand, Z as RawFindOneAndUpdateCommand, _ as MongoAggOperator, a as FindOneAndUpdateCommand, at as freezeMongoResultShape, b as MongoBucketAutoStage, c as MongoAddFieldsStage, d as MongoAggCond, et as RawUpdateManyCommand, f as MongoAggFieldRef, g as MongoAggMergeObjects, h as MongoAggMap, i as FindOneAndDeleteCommand, it as freezeMongoFieldShape, j as MongoMatchStage, k as MongoLimitStage, l as MongoAggAccumulator, m as MongoAggLiteral, n as DeleteManyCommand, nt as UpdateManyCommand, o as InsertManyCommand, ot as isExprArray, p as MongoAggLet, q as RawAggregateCommand, r as DeleteOneCommand, rt as UpdateOneCommand, s as InsertOneCommand, st as isRecordArgs, t as AggregateCommand, tt as RawUpdateOneCommand, u as MongoAggArrayFilter, v as MongoAggReduce, w as MongoFacetStage, x as MongoBucketStage, y as MongoAggSwitch, z as MongoSearchStage } from "./execution-
|
|
2
|
+
import { $ as RawInsertOneCommand, A as MongoLookupStage, B as MongoSetWindowFieldsStage, C as MongoDensifyStage, D as MongoGraphLookupStage, E as MongoGeoNearStage, F as MongoRedactStage, G as MongoUnwindStage, H as MongoSortByCountStage, I as MongoReplaceRootStage, J as RawDeleteManyCommand, K as MongoVectorSearchStage, L as MongoSampleStage, M as MongoMergeStage, N as MongoOutStage, O as MongoGroupStage, P as MongoProjectStage, Q as RawInsertManyCommand, R as MongoSearchMetaStage, S as MongoCountStage, T as MongoFillStage, U as MongoSortStage, V as MongoSkipStage, W as MongoUnionWithStage, X as RawFindOneAndDeleteCommand, Y as RawDeleteOneCommand, Z as RawFindOneAndUpdateCommand, _ as MongoAggOperator, a as FindOneAndUpdateCommand, at as freezeMongoResultShape, b as MongoBucketAutoStage, c as MongoAddFieldsStage, d as MongoAggCond, et as RawUpdateManyCommand, f as MongoAggFieldRef, g as MongoAggMergeObjects, h as MongoAggMap, i as FindOneAndDeleteCommand, it as freezeMongoFieldShape, j as MongoMatchStage, k as MongoLimitStage, l as MongoAggAccumulator, m as MongoAggLiteral, n as DeleteManyCommand, nt as UpdateManyCommand, o as InsertManyCommand, ot as isExprArray, p as MongoAggLet, q as RawAggregateCommand, r as DeleteOneCommand, rt as UpdateOneCommand, s as InsertOneCommand, st as isRecordArgs, t as AggregateCommand, tt as RawUpdateOneCommand, u as MongoAggArrayFilter, v as MongoAggReduce, w as MongoFacetStage, x as MongoBucketStage, y as MongoAggSwitch, z as MongoSearchStage } from "./execution-CgP1Sdbr.mjs";
|
|
3
3
|
export { AggregateCommand, DeleteManyCommand, DeleteOneCommand, FindOneAndDeleteCommand, FindOneAndUpdateCommand, InsertManyCommand, InsertOneCommand, MongoAddFieldsStage, MongoAggAccumulator, MongoAggArrayFilter, MongoAggCond, MongoAggFieldRef, MongoAggLet, MongoAggLiteral, MongoAggMap, MongoAggMergeObjects, MongoAggOperator, MongoAggReduce, MongoAggSwitch, MongoAndExpr, MongoBucketAutoStage, MongoBucketStage, MongoCountStage, MongoDensifyStage, MongoExistsExpr, MongoExprFilter, MongoFacetStage, MongoFieldFilter, MongoFillStage, MongoGeoNearStage, MongoGraphLookupStage, MongoGroupStage, MongoLimitStage, MongoLookupStage, MongoMatchStage, MongoMergeStage, MongoNotExpr, MongoOrExpr, MongoOutStage, MongoProjectStage, MongoRedactStage, MongoReplaceRootStage, MongoSampleStage, MongoSearchMetaStage, MongoSearchStage, MongoSetWindowFieldsStage, MongoSkipStage, MongoSortByCountStage, MongoSortStage, MongoUnionWithStage, MongoUnwindStage, MongoVectorSearchStage, RawAggregateCommand, RawDeleteManyCommand, RawDeleteOneCommand, RawFindOneAndDeleteCommand, RawFindOneAndUpdateCommand, RawInsertManyCommand, RawInsertOneCommand, RawUpdateManyCommand, RawUpdateOneCommand, UpdateManyCommand, UpdateOneCommand, freezeMongoFieldShape, freezeMongoResultShape, isExprArray, isMongoFilterExpr, isRecordArgs };
|