@nullix/zod-mongoose-studio 1.0.13 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Db4IAypj.js → 0J_bLG6U.js} +1 -1
  3. package/.output/public/_nuxt/{Y39o1QEi.js → 5KLjKHc1.js} +1 -1
  4. package/.output/public/_nuxt/{B4zoPYF-.js → B2UrsJHg.js} +1 -1
  5. package/.output/public/_nuxt/{BSqjh6Vk.js → BC5hGokz.js} +1 -1
  6. package/.output/public/_nuxt/{BS4yU4O0.js → BJwN20Xm.js} +1 -1
  7. package/.output/public/_nuxt/{D8_n84hl.js → BMgDPqps.js} +1 -1
  8. package/.output/public/_nuxt/{CqNsQbt9.js → B_sGF2qN.js} +1 -1
  9. package/.output/public/_nuxt/{NAqlztEN.js → BeaJ7I-K.js} +10 -10
  10. package/.output/public/_nuxt/{WZ0WK9cR.js → BkE1sm_1.js} +1 -1
  11. package/.output/public/_nuxt/{kBtP64Rx.js → CADbZwE5.js} +1 -1
  12. package/.output/public/_nuxt/{B8qGaxNm.js → CB0WRoVi.js} +1 -1
  13. package/.output/public/_nuxt/{BV6uALfO.js → CCh0PVV0.js} +1 -1
  14. package/.output/public/_nuxt/{CP9Z7-_9.js → Cr0GW7rA.js} +1 -1
  15. package/.output/public/_nuxt/{DeCqoVOS.js → DJe7Wxdv.js} +1 -1
  16. package/.output/public/_nuxt/{dBZQW7JD.js → DRBrUaE5.js} +1 -1
  17. package/.output/public/_nuxt/{Db19R32y.js → DV2n9B6m.js} +1 -1
  18. package/.output/public/_nuxt/{CvnpbYw0.js → DVD-jGiv.js} +1 -1
  19. package/.output/public/_nuxt/{BWajNATZ.js → Dk9qGA5X.js} +3 -3
  20. package/.output/public/_nuxt/builds/latest.json +1 -1
  21. package/.output/public/_nuxt/builds/meta/dc761332-547d-4953-b51d-b2d453009b48.json +1 -0
  22. package/.output/public/_nuxt/error-404.64pZEiDn.css +1 -0
  23. package/.output/public/_nuxt/error-500.DHOpI0Ir.css +1 -0
  24. package/.output/public/_nuxt/{BoHhCIKW.js → koEZfutw.js} +3 -3
  25. package/.output/public/_nuxt/{B_782F4p.js → r6LdR7DN.js} +1 -1
  26. package/.output/public/_nuxt/{BEI71c6K.js → rEfOp38p.js} +1 -1
  27. package/.output/server/chunks/_/error-500.mjs.map +1 -1
  28. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  29. package/.output/server/chunks/build/{error-404-8tbBXju4.mjs → error-404-BN-7rNE4.mjs} +4 -4
  30. package/.output/server/chunks/build/error-404-BN-7rNE4.mjs.map +1 -0
  31. package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs +8 -0
  32. package/.output/server/chunks/build/error-404-styles.Byx46oLR.mjs.map +1 -0
  33. package/.output/server/chunks/build/{error-500-DxFsom1i.mjs → error-500-DhIQ-2yt.mjs} +4 -4
  34. package/.output/server/chunks/build/error-500-DhIQ-2yt.mjs.map +1 -0
  35. package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs +8 -0
  36. package/.output/server/chunks/build/error-500-styles.BL3UT0Wa.mjs.map +1 -0
  37. package/.output/server/chunks/build/{index-BB-Clavm.mjs → index-Dnrh1ePF.mjs} +1 -1
  38. package/.output/server/chunks/build/index-Dnrh1ePF.mjs.map +1 -0
  39. package/.output/server/chunks/build/server.mjs +9 -9
  40. package/.output/server/chunks/build/styles.mjs +4 -4
  41. package/.output/server/chunks/nitro/nitro.mjs +333 -333
  42. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  43. package/.output/server/chunks/routes/renderer.mjs.map +1 -1
  44. package/.output/server/node_modules/bson/lib/bson.cjs +157 -48
  45. package/.output/server/node_modules/bson/package.json +9 -11
  46. package/.output/server/node_modules/kareem/index.js +228 -343
  47. package/.output/server/node_modules/kareem/package.json +3 -3
  48. package/.output/server/node_modules/mongodb/lib/bson.js +27 -5
  49. package/.output/server/node_modules/mongodb/lib/bulk/common.js +7 -9
  50. package/.output/server/node_modules/mongodb/lib/change_stream.js +91 -39
  51. package/.output/server/node_modules/mongodb/lib/client-side-encryption/auto_encrypter.js +21 -14
  52. package/.output/server/node_modules/mongodb/lib/client-side-encryption/client_encryption.js +2 -5
  53. package/.output/server/node_modules/mongodb/lib/client-side-encryption/errors.js +3 -1
  54. package/.output/server/node_modules/mongodb/lib/client-side-encryption/mongocryptd_manager.js +1 -1
  55. package/.output/server/node_modules/mongodb/lib/client-side-encryption/state_machine.js +1 -0
  56. package/.output/server/node_modules/mongodb/lib/cmap/auth/aws4.js +161 -0
  57. package/.output/server/node_modules/mongodb/lib/cmap/auth/aws_temporary_credentials.js +11 -58
  58. package/.output/server/node_modules/mongodb/lib/cmap/auth/gssapi.js +4 -6
  59. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js +2 -16
  60. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js +14 -23
  61. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/azure_machine_workflow.js +3 -3
  62. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/gcp_machine_workflow.js +3 -3
  63. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/k8s_machine_workflow.js +4 -3
  64. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc/token_machine_workflow.js +4 -3
  65. package/.output/server/node_modules/mongodb/lib/cmap/auth/mongodb_oidc.js +4 -4
  66. package/.output/server/node_modules/mongodb/lib/cmap/auth/plain.js +1 -1
  67. package/.output/server/node_modules/mongodb/lib/cmap/auth/providers.js +0 -1
  68. package/.output/server/node_modules/mongodb/lib/cmap/auth/scram.js +53 -40
  69. package/.output/server/node_modules/mongodb/lib/cmap/commands.js +46 -39
  70. package/.output/server/node_modules/mongodb/lib/cmap/connect.js +35 -3
  71. package/.output/server/node_modules/mongodb/lib/cmap/connection.js +36 -32
  72. package/.output/server/node_modules/mongodb/lib/cmap/connection_pool.js +67 -67
  73. package/.output/server/node_modules/mongodb/lib/cmap/connection_pool_events.js +3 -3
  74. package/.output/server/node_modules/mongodb/lib/cmap/errors.js +1 -1
  75. package/.output/server/node_modules/mongodb/lib/cmap/handshake/client_metadata.js +15 -13
  76. package/.output/server/node_modules/mongodb/lib/cmap/metrics.js +3 -3
  77. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/compression.js +26 -10
  78. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/constants.js +3 -1
  79. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_data.js +0 -1
  80. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/on_demand/document.js +9 -9
  81. package/.output/server/node_modules/mongodb/lib/cmap/wire_protocol/responses.js +2 -2
  82. package/.output/server/node_modules/mongodb/lib/collection.js +1 -1
  83. package/.output/server/node_modules/mongodb/lib/connection_string.js +30 -15
  84. package/.output/server/node_modules/mongodb/lib/cursor/abstract_cursor.js +17 -34
  85. package/.output/server/node_modules/mongodb/lib/cursor/change_stream_cursor.js +2 -2
  86. package/.output/server/node_modules/mongodb/lib/cursor/find_cursor.js +37 -26
  87. package/.output/server/node_modules/mongodb/lib/cursor/run_command_cursor.js +1 -1
  88. package/.output/server/node_modules/mongodb/lib/db.js +6 -7
  89. package/.output/server/node_modules/mongodb/lib/deps.js +0 -13
  90. package/.output/server/node_modules/mongodb/lib/error.js +7 -10
  91. package/.output/server/node_modules/mongodb/lib/gridfs/download.js +7 -6
  92. package/.output/server/node_modules/mongodb/lib/gridfs/index.js +9 -9
  93. package/.output/server/node_modules/mongodb/lib/gridfs/upload.js +17 -23
  94. package/.output/server/node_modules/mongodb/lib/index.js +2 -4
  95. package/.output/server/node_modules/mongodb/lib/mongo_client.js +58 -67
  96. package/.output/server/node_modules/mongodb/lib/mongo_client_auth_providers.js +0 -6
  97. package/.output/server/node_modules/mongodb/lib/mongo_logger.js +11 -5
  98. package/.output/server/node_modules/mongodb/lib/mongo_types.js +1 -2
  99. package/.output/server/node_modules/mongodb/lib/operations/aggregate.js +0 -3
  100. package/.output/server/node_modules/mongodb/lib/operations/create_collection.js +0 -1
  101. package/.output/server/node_modules/mongodb/lib/operations/drop.js +8 -9
  102. package/.output/server/node_modules/mongodb/lib/operations/end_sessions.js +34 -0
  103. package/.output/server/node_modules/mongodb/lib/operations/execute_operation.js +121 -45
  104. package/.output/server/node_modules/mongodb/lib/operations/operation.js +1 -0
  105. package/.output/server/node_modules/mongodb/lib/read_preference.js +10 -14
  106. package/.output/server/node_modules/mongodb/lib/runtime_adapters.js +32 -0
  107. package/.output/server/node_modules/mongodb/lib/sdam/monitor.js +8 -8
  108. package/.output/server/node_modules/mongodb/lib/sdam/server.js +55 -43
  109. package/.output/server/node_modules/mongodb/lib/sdam/server_description.js +1 -1
  110. package/.output/server/node_modules/mongodb/lib/sdam/server_selection.js +135 -72
  111. package/.output/server/node_modules/mongodb/lib/sdam/srv_polling.js +3 -3
  112. package/.output/server/node_modules/mongodb/lib/sdam/topology.js +37 -77
  113. package/.output/server/node_modules/mongodb/lib/sdam/topology_description.js +1 -1
  114. package/.output/server/node_modules/mongodb/lib/sessions.js +150 -40
  115. package/.output/server/node_modules/mongodb/lib/transactions.js +2 -13
  116. package/.output/server/node_modules/mongodb/lib/utils.js +42 -90
  117. package/.output/server/node_modules/mongodb/package.json +49 -45
  118. package/.output/server/node_modules/mongodb-connection-string-url/lib/index.js +45 -19
  119. package/.output/server/node_modules/mongodb-connection-string-url/lib/redact.js +30 -19
  120. package/.output/server/node_modules/mongodb-connection-string-url/package.json +25 -16
  121. package/.output/server/node_modules/mongoose/lib/aggregate.js +108 -127
  122. package/.output/server/node_modules/mongoose/lib/cast/bigint.js +3 -3
  123. package/.output/server/node_modules/mongoose/lib/cast/boolean.js +3 -3
  124. package/.output/server/node_modules/mongoose/lib/cast/double.js +4 -4
  125. package/.output/server/node_modules/mongoose/lib/cast/int32.js +2 -2
  126. package/.output/server/node_modules/mongoose/lib/cast/number.js +6 -6
  127. package/.output/server/node_modules/mongoose/lib/cast/string.js +3 -3
  128. package/.output/server/node_modules/mongoose/lib/cast/uuid.js +5 -48
  129. package/.output/server/node_modules/mongoose/lib/cast.js +16 -24
  130. package/.output/server/node_modules/mongoose/lib/collection.js +6 -6
  131. package/.output/server/node_modules/mongoose/lib/connection.js +108 -105
  132. package/.output/server/node_modules/mongoose/lib/cursor/aggregationCursor.js +23 -33
  133. package/.output/server/node_modules/mongoose/lib/cursor/changeStream.js +60 -40
  134. package/.output/server/node_modules/mongoose/lib/cursor/queryCursor.js +21 -25
  135. package/.output/server/node_modules/mongoose/lib/document.js +712 -531
  136. package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js +85 -130
  137. package/.output/server/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js +32 -41
  138. package/.output/server/node_modules/mongoose/lib/error/cast.js +21 -12
  139. package/.output/server/node_modules/mongoose/lib/error/createCollectionsError.js +2 -2
  140. package/.output/server/node_modules/mongoose/lib/error/divergentArray.js +1 -1
  141. package/.output/server/node_modules/mongoose/lib/error/eachAsyncMultiError.js +1 -1
  142. package/.output/server/node_modules/mongoose/lib/error/index.js +3 -3
  143. package/.output/server/node_modules/mongoose/lib/error/invalidSchemaOption.js +1 -1
  144. package/.output/server/node_modules/mongoose/lib/error/messages.js +1 -0
  145. package/.output/server/node_modules/mongoose/lib/error/missingSchema.js +1 -1
  146. package/.output/server/node_modules/mongoose/lib/error/objectParameter.js +4 -5
  147. package/.output/server/node_modules/mongoose/lib/error/overwriteModel.js +1 -1
  148. package/.output/server/node_modules/mongoose/lib/error/setOptionError.js +3 -3
  149. package/.output/server/node_modules/mongoose/lib/error/strict.js +3 -3
  150. package/.output/server/node_modules/mongoose/lib/error/strictPopulate.js +2 -2
  151. package/.output/server/node_modules/mongoose/lib/error/syncIndexes.js +2 -2
  152. package/.output/server/node_modules/mongoose/lib/error/validation.js +2 -10
  153. package/.output/server/node_modules/mongoose/lib/error/validator.js +1 -1
  154. package/.output/server/node_modules/mongoose/lib/error/version.js +2 -2
  155. package/.output/server/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js +4 -4
  156. package/.output/server/node_modules/mongoose/lib/helpers/buildMiddlewareFilter.js +24 -0
  157. package/.output/server/node_modules/mongoose/lib/helpers/clone.js +35 -18
  158. package/.output/server/node_modules/mongoose/lib/helpers/common.js +5 -5
  159. package/.output/server/node_modules/mongoose/lib/helpers/cursor/eachAsync.js +4 -4
  160. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js +1 -1
  161. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js +1 -1
  162. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js +1 -1
  163. package/.output/server/node_modules/mongoose/lib/helpers/discriminator/mergeDiscriminatorSchema.js +10 -5
  164. package/.output/server/node_modules/mongoose/lib/helpers/document/applyDefaults.js +1 -1
  165. package/.output/server/node_modules/mongoose/lib/helpers/document/applyTimestamps.js +11 -10
  166. package/.output/server/node_modules/mongoose/lib/helpers/document/applyVirtuals.js +10 -9
  167. package/.output/server/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js +1 -1
  168. package/.output/server/node_modules/mongoose/lib/helpers/document/compile.js +17 -14
  169. package/.output/server/node_modules/mongoose/lib/helpers/document/getDeepestSubdocumentForPath.js +3 -3
  170. package/.output/server/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js +2 -2
  171. package/.output/server/node_modules/mongoose/lib/helpers/document/isInPathsToSave.js +24 -0
  172. package/.output/server/node_modules/mongoose/lib/helpers/get.js +1 -1
  173. package/.output/server/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js +1 -1
  174. package/.output/server/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js +3 -3
  175. package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js +3 -4
  176. package/.output/server/node_modules/mongoose/lib/helpers/indexes/isIndexSpecEqual.js +3 -3
  177. package/.output/server/node_modules/mongoose/lib/helpers/isBsonType.js +1 -1
  178. package/.output/server/node_modules/mongoose/lib/helpers/isMongooseObject.js +1 -1
  179. package/.output/server/node_modules/mongoose/lib/helpers/isObject.js +2 -2
  180. package/.output/server/node_modules/mongoose/lib/helpers/isSimpleValidator.js +2 -2
  181. package/.output/server/node_modules/mongoose/lib/helpers/minimize.js +2 -2
  182. package/.output/server/node_modules/mongoose/lib/helpers/model/applyDefaultsToPOJO.js +2 -2
  183. package/.output/server/node_modules/mongoose/lib/helpers/model/applyHooks.js +55 -54
  184. package/.output/server/node_modules/mongoose/lib/helpers/model/applyMethods.js +2 -2
  185. package/.output/server/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js +1 -48
  186. package/.output/server/node_modules/mongoose/lib/helpers/model/castBulkWrite.js +8 -12
  187. package/.output/server/node_modules/mongoose/lib/helpers/model/discriminator.js +1 -1
  188. package/.output/server/node_modules/mongoose/lib/helpers/parallelLimit.js +18 -36
  189. package/.output/server/node_modules/mongoose/lib/helpers/pluralize.js +4 -4
  190. package/.output/server/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js +4 -11
  191. package/.output/server/node_modules/mongoose/lib/helpers/populate/assignVals.js +10 -10
  192. package/.output/server/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js +3 -3
  193. package/.output/server/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js +197 -69
  194. package/.output/server/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js +15 -15
  195. package/.output/server/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js +1 -1
  196. package/.output/server/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js +10 -2
  197. package/.output/server/node_modules/mongoose/lib/helpers/populate/setPopulatedVirtualValue.js +5 -5
  198. package/.output/server/node_modules/mongoose/lib/helpers/printJestWarning.js +1 -1
  199. package/.output/server/node_modules/mongoose/lib/helpers/processConnectionOptions.js +1 -1
  200. package/.output/server/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js +1 -1
  201. package/.output/server/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js +3 -3
  202. package/.output/server/node_modules/mongoose/lib/helpers/projection/isSubpath.js +1 -1
  203. package/.output/server/node_modules/mongoose/lib/helpers/projection/parseProjection.js +9 -4
  204. package/.output/server/node_modules/mongoose/lib/helpers/query/cast$expr.js +8 -10
  205. package/.output/server/node_modules/mongoose/lib/helpers/query/castFilterPath.js +1 -1
  206. package/.output/server/node_modules/mongoose/lib/helpers/query/castUpdate.js +44 -38
  207. package/.output/server/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js +8 -8
  208. package/.output/server/node_modules/mongoose/lib/helpers/query/handleImmutable.js +8 -8
  209. package/.output/server/node_modules/mongoose/lib/helpers/schema/applyPlugins.js +2 -2
  210. package/.output/server/node_modules/mongoose/lib/helpers/schema/applyReadConcern.js +1 -1
  211. package/.output/server/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js +4 -2
  212. package/.output/server/node_modules/mongoose/lib/helpers/schema/getIndexes.js +5 -11
  213. package/.output/server/node_modules/mongoose/lib/helpers/schema/getSubdocumentStrictValue.js +2 -2
  214. package/.output/server/node_modules/mongoose/lib/helpers/schema/handleIdOption.js +1 -1
  215. package/.output/server/node_modules/mongoose/lib/helpers/schema/idGetter.js +1 -1
  216. package/.output/server/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js +1 -1
  217. package/.output/server/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js +26 -13
  218. package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setDocumentTimestamps.js +2 -2
  219. package/.output/server/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js +60 -38
  220. package/.output/server/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js +13 -10
  221. package/.output/server/node_modules/mongoose/lib/helpers/update/castArrayFilters.js +4 -4
  222. package/.output/server/node_modules/mongoose/lib/helpers/update/decorateUpdateWithVersionKey.js +1 -1
  223. package/.output/server/node_modules/mongoose/lib/helpers/update/modifiedPaths.js +2 -2
  224. package/.output/server/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js +7 -2
  225. package/.output/server/node_modules/mongoose/lib/helpers/updateValidators.js +58 -119
  226. package/.output/server/node_modules/mongoose/lib/model.js +940 -946
  227. package/.output/server/node_modules/mongoose/lib/mongoose.js +131 -79
  228. package/.output/server/node_modules/mongoose/lib/options/schemaArrayOptions.js +2 -2
  229. package/.output/server/node_modules/mongoose/lib/options/schemaBufferOptions.js +1 -1
  230. package/.output/server/node_modules/mongoose/lib/options/schemaDocumentArrayOptions.js +23 -0
  231. package/.output/server/node_modules/mongoose/lib/options/schemaNumberOptions.js +3 -3
  232. package/.output/server/node_modules/mongoose/lib/options/schemaObjectIdOptions.js +2 -2
  233. package/.output/server/node_modules/mongoose/lib/options/schemaStringOptions.js +6 -6
  234. package/.output/server/node_modules/mongoose/lib/options/schemaSubdocumentOptions.js +23 -0
  235. package/.output/server/node_modules/mongoose/lib/options/schemaTypeOptions.js +27 -13
  236. package/.output/server/node_modules/mongoose/lib/options/virtualOptions.js +12 -12
  237. package/.output/server/node_modules/mongoose/lib/plugins/index.js +0 -1
  238. package/.output/server/node_modules/mongoose/lib/plugins/saveSubdocs.js +84 -92
  239. package/.output/server/node_modules/mongoose/lib/plugins/sharding.js +33 -15
  240. package/.output/server/node_modules/mongoose/lib/plugins/trackTransaction.js +29 -25
  241. package/.output/server/node_modules/mongoose/lib/query.js +700 -548
  242. package/.output/server/node_modules/mongoose/lib/queryHelpers.js +34 -32
  243. package/.output/server/node_modules/mongoose/lib/schema/array.js +69 -113
  244. package/.output/server/node_modules/mongoose/lib/schema/bigint.js +18 -20
  245. package/.output/server/node_modules/mongoose/lib/schema/boolean.js +20 -22
  246. package/.output/server/node_modules/mongoose/lib/schema/buffer.js +23 -25
  247. package/.output/server/node_modules/mongoose/lib/schema/date.js +19 -21
  248. package/.output/server/node_modules/mongoose/lib/schema/decimal128.js +16 -18
  249. package/.output/server/node_modules/mongoose/lib/schema/documentArray.js +94 -131
  250. package/.output/server/node_modules/mongoose/lib/schema/documentArrayElement.js +50 -16
  251. package/.output/server/node_modules/mongoose/lib/schema/double.js +16 -18
  252. package/.output/server/node_modules/mongoose/lib/schema/index.js +1 -0
  253. package/.output/server/node_modules/mongoose/lib/schema/int32.js +17 -19
  254. package/.output/server/node_modules/mongoose/lib/schema/map.js +17 -24
  255. package/.output/server/node_modules/mongoose/lib/schema/mixed.js +14 -14
  256. package/.output/server/node_modules/mongoose/lib/schema/number.js +38 -28
  257. package/.output/server/node_modules/mongoose/lib/schema/objectId.js +18 -20
  258. package/.output/server/node_modules/mongoose/lib/schema/operators/exists.js +1 -1
  259. package/.output/server/node_modules/mongoose/lib/schema/operators/geospatial.js +1 -1
  260. package/.output/server/node_modules/mongoose/lib/schema/operators/text.js +4 -4
  261. package/.output/server/node_modules/mongoose/lib/schema/string.js +42 -27
  262. package/.output/server/node_modules/mongoose/lib/schema/subdocument.js +47 -58
  263. package/.output/server/node_modules/mongoose/lib/schema/union.js +54 -4
  264. package/.output/server/node_modules/mongoose/lib/schema/uuid.js +17 -40
  265. package/.output/server/node_modules/mongoose/lib/schema.js +235 -176
  266. package/.output/server/node_modules/mongoose/lib/schemaType.js +227 -158
  267. package/.output/server/node_modules/mongoose/lib/stateMachine.js +5 -8
  268. package/.output/server/node_modules/mongoose/lib/types/array/index.js +5 -5
  269. package/.output/server/node_modules/mongoose/lib/types/array/methods/index.js +27 -28
  270. package/.output/server/node_modules/mongoose/lib/types/arraySubdocument.js +11 -11
  271. package/.output/server/node_modules/mongoose/lib/types/buffer.js +15 -15
  272. package/.output/server/node_modules/mongoose/lib/types/decimal128.js +1 -1
  273. package/.output/server/node_modules/mongoose/lib/types/documentArray/index.js +4 -4
  274. package/.output/server/node_modules/mongoose/lib/types/documentArray/methods/index.js +15 -13
  275. package/.output/server/node_modules/mongoose/lib/types/double.js +1 -1
  276. package/.output/server/node_modules/mongoose/lib/types/map.js +20 -71
  277. package/.output/server/node_modules/mongoose/lib/types/objectid.js +1 -1
  278. package/.output/server/node_modules/mongoose/lib/types/subdocument.js +32 -81
  279. package/.output/server/node_modules/mongoose/lib/types/uuid.js +1 -1
  280. package/.output/server/node_modules/mongoose/lib/utils.js +91 -70
  281. package/.output/server/node_modules/mongoose/lib/validOptions.js +4 -3
  282. package/.output/server/node_modules/mongoose/lib/virtualType.js +18 -18
  283. package/.output/server/node_modules/mongoose/package.json +46 -63
  284. package/.output/server/node_modules/mquery/lib/collection/collection.js +3 -1
  285. package/.output/server/node_modules/mquery/lib/collection/node.js +17 -3
  286. package/.output/server/node_modules/mquery/lib/mquery.js +136 -93
  287. package/.output/server/node_modules/mquery/lib/permissions.js +21 -6
  288. package/.output/server/node_modules/mquery/package.json +4 -7
  289. package/.output/server/package.json +7 -9
  290. package/package.json +3 -3
  291. package/.output/public/_nuxt/builds/meta/0d6006db-fbb0-4297-85cf-bf92ceafcb79.json +0 -1
  292. package/.output/public/_nuxt/error-404.CTWLHxjC.css +0 -1
  293. package/.output/public/_nuxt/error-500.UBfk8-QP.css +0 -1
  294. package/.output/server/chunks/build/error-404-8tbBXju4.mjs.map +0 -1
  295. package/.output/server/chunks/build/error-404-styles.BeWfK6Py.mjs +0 -8
  296. package/.output/server/chunks/build/error-404-styles.BeWfK6Py.mjs.map +0 -1
  297. package/.output/server/chunks/build/error-500-DxFsom1i.mjs.map +0 -1
  298. package/.output/server/chunks/build/error-500-styles.CPUUvoY-.mjs +0 -8
  299. package/.output/server/chunks/build/error-500-styles.CPUUvoY-.mjs.map +0 -1
  300. package/.output/server/chunks/build/index-BB-Clavm.mjs.map +0 -1
  301. package/.output/server/node_modules/debug/package.json +0 -64
  302. package/.output/server/node_modules/debug/src/browser.js +0 -272
  303. package/.output/server/node_modules/debug/src/common.js +0 -292
  304. package/.output/server/node_modules/debug/src/index.js +0 -10
  305. package/.output/server/node_modules/debug/src/node.js +0 -263
  306. package/.output/server/node_modules/mongodb/lib/client-side-encryption/crypto_callbacks.js +0 -81
  307. package/.output/server/node_modules/mongodb/lib/resource_management.js +0 -58
  308. package/.output/server/node_modules/mongoose/lib/browserDocument.js +0 -101
  309. package/.output/server/node_modules/mongoose/lib/documentProvider.js +0 -30
  310. package/.output/server/node_modules/mongoose/lib/helpers/createJSONSchemaTypeDefinition.js +0 -24
  311. package/.output/server/node_modules/mongoose/lib/helpers/promiseOrCallback.js +0 -54
  312. package/.output/server/node_modules/mongoose/lib/plugins/validateBeforeSave.js +0 -51
  313. package/.output/server/node_modules/supports-color/index.js +0 -202
  314. package/.output/server/node_modules/supports-color/package.json +0 -64
@@ -4,7 +4,7 @@
4
4
  * Module dependencies.
5
5
  */
6
6
 
7
- const UUID = require('bson').UUID;
7
+ const UUID = require('mongodb/lib/bson').UUID;
8
8
  const ms = require('ms');
9
9
  const mpath = require('mpath');
10
10
  const ObjectId = require('./types/objectid');
@@ -18,7 +18,6 @@ const isBsonType = require('./helpers/isBsonType');
18
18
  const isPOJO = require('./helpers/isPOJO');
19
19
  const getFunctionName = require('./helpers/getFunctionName');
20
20
  const isMongooseObject = require('./helpers/isMongooseObject');
21
- const promiseOrCallback = require('./helpers/promiseOrCallback');
22
21
  const schemaMerge = require('./helpers/schema/merge');
23
22
  const specialProperties = require('./helpers/specialProperties');
24
23
  const { trustedSymbol } = require('./helpers/query/trusted');
@@ -39,9 +38,9 @@ const manySpaceRE = /\s+/;
39
38
  * Produces a collection name from model `name`. By default, just returns
40
39
  * the model name
41
40
  *
42
- * @param {String} name a model name
41
+ * @param {string} name a model name
43
42
  * @param {Function} pluralize function that pluralizes the collection name
44
- * @return {String} a collection name
43
+ * @return {string} a collection name
45
44
  * @api private
46
45
  */
47
46
 
@@ -71,7 +70,7 @@ exports.toCollectionName = function(name, pluralize) {
71
70
  *
72
71
  * @param {any} a a value to compare to `b`
73
72
  * @param {any} b a value to compare to `a`
74
- * @return {Boolean}
73
+ * @return {boolean}
75
74
  * @api private
76
75
  */
77
76
 
@@ -120,6 +119,16 @@ exports.deepEqual = function deepEqual(a, b) {
120
119
  deepEqual(Array.from(a.values()), Array.from(b.values()));
121
120
  }
122
121
 
122
+ if (a instanceof Set || b instanceof Set) {
123
+ if (!(a instanceof Set) || !(b instanceof Set)) {
124
+ return false;
125
+ }
126
+ if (a.size !== b.size) {
127
+ return false;
128
+ }
129
+ return deepEqual(Array.from(a.values()), Array.from(b.values()));
130
+ }
131
+
123
132
  // Handle MongooseNumbers
124
133
  if (a instanceof Number && b instanceof Number) {
125
134
  return a.valueOf() === b.valueOf();
@@ -191,18 +200,15 @@ exports.deepEqual = function deepEqual(a, b) {
191
200
  */
192
201
 
193
202
  exports.last = function(arr) {
203
+ if (arr == null) {
204
+ return void 0;
205
+ }
194
206
  if (arr.length > 0) {
195
207
  return arr[arr.length - 1];
196
208
  }
197
209
  return void 0;
198
210
  };
199
211
 
200
- /*!
201
- * ignore
202
- */
203
-
204
- exports.promiseOrCallback = promiseOrCallback;
205
-
206
212
  /*!
207
213
  * ignore
208
214
  */
@@ -236,7 +242,7 @@ exports.omit = function omit(obj, keys) {
236
242
 
237
243
  /**
238
244
  * Simplified version of `clone()` that only clones POJOs and arrays. Skips documents, dates, objectids, etc.
239
- * @param {*} val
245
+ * @param {any} val
240
246
  * @returns
241
247
  */
242
248
 
@@ -269,16 +275,20 @@ exports.clonePOJOsAndArrays = function clonePOJOsAndArrays(val) {
269
275
  /**
270
276
  * Merges `from` into `to` without overwriting existing properties.
271
277
  *
272
- * @param {Object} to
273
- * @param {Object} from
274
- * @param {Object} [options]
275
- * @param {String} [path]
278
+ * @param {object} to
279
+ * @param {object} from
280
+ * @param {object} [options]
281
+ * @param {string} [path]
276
282
  * @api private
277
283
  */
278
284
 
279
285
  exports.merge = function merge(to, from, options, path) {
280
286
  options = options || {};
281
287
 
288
+ if (from == null) {
289
+ return to;
290
+ }
291
+
282
292
  const keys = Object.keys(from);
283
293
  let i = 0;
284
294
  const len = keys.length;
@@ -313,8 +323,8 @@ exports.merge = function merge(to, from, options, path) {
313
323
  // base schema has a given path as a single nested but discriminator schema
314
324
  // has the path as a document array, or vice versa (gh-9534)
315
325
  if (options.isDiscriminatorSchemaMerge &&
316
- (from[key].$isSingleNested && to[key].$isMongooseDocumentArray) ||
317
- (from[key].$isMongooseDocumentArray && to[key].$isSingleNested)) {
326
+ ((from[key].$isSingleNested && to[key].$isMongooseDocumentArray) ||
327
+ (from[key].$isMongooseDocumentArray && to[key].$isSingleNested))) {
318
328
  continue;
319
329
  } else if (from[key].instanceOfSchema) {
320
330
  if (to[key].instanceOfSchema) {
@@ -340,8 +350,8 @@ exports.merge = function merge(to, from, options, path) {
340
350
  /**
341
351
  * Applies toObject recursively.
342
352
  *
343
- * @param {Document|Array|Object} obj
344
- * @return {Object}
353
+ * @param {Document|Array|object} obj
354
+ * @return {object}
345
355
  * @api private
346
356
  */
347
357
 
@@ -396,9 +406,9 @@ exports.isObject = isObject;
396
406
  *
397
407
  * `Object.getPrototypeOf()` is part of ES5: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf
398
408
  *
399
- * @param {Object|Array|String|Function|RegExp|any} arg
409
+ * @param {object|Array|string|Function|RegExp|any} arg
400
410
  * @api private
401
- * @return {Boolean}
411
+ * @return {boolean}
402
412
  */
403
413
 
404
414
  exports.isPOJO = require('./helpers/isPOJO');
@@ -406,7 +416,7 @@ exports.isPOJO = require('./helpers/isPOJO');
406
416
  /**
407
417
  * Determines if `arg` is an object that isn't an instance of a built-in value
408
418
  * class, like Array, Buffer, ObjectId, etc.
409
- * @param {Any} val
419
+ * @param {any} val
410
420
  */
411
421
 
412
422
  exports.isNonBuiltinObject = function isNonBuiltinObject(val) {
@@ -420,7 +430,7 @@ exports.isNonBuiltinObject = function isNonBuiltinObject(val) {
420
430
  /**
421
431
  * Determines if `obj` is a built-in object like an array, date, boolean,
422
432
  * etc.
423
- * @param {Any} arg
433
+ * @param {any} arg
424
434
  */
425
435
 
426
436
  exports.isNativeObject = function(arg) {
@@ -433,20 +443,36 @@ exports.isNativeObject = function(arg) {
433
443
 
434
444
  /**
435
445
  * Determines if `val` is an object that has no own keys
436
- * @param {Any} val
446
+ * @param {any} val
447
+ */
448
+
449
+ exports.isEmptyObject = function isEmptyObject(val) {
450
+ if (val == null || typeof val !== 'object') {
451
+ return false;
452
+ }
453
+ return exports.hasOwnKeys(val) === false;
454
+ };
455
+
456
+ /**
457
+ * Determines if `obj` has any own keys. Assumes obj is already an object.
458
+ * Faster than Object.keys(obj).length > 0.
459
+ * @param {object} obj
437
460
  */
438
461
 
439
- exports.isEmptyObject = function(val) {
440
- return val != null &&
441
- typeof val === 'object' &&
442
- Object.keys(val).length === 0;
462
+ exports.hasOwnKeys = function hasOwnKeys(obj) {
463
+ for (const key in obj) {
464
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
465
+ return true;
466
+ }
467
+ }
468
+ return false;
443
469
  };
444
470
 
445
471
  /**
446
472
  * Search if `obj` or any POJOs nested underneath `obj` has a property named
447
473
  * `key`
448
- * @param {Object} obj
449
- * @param {String} key
474
+ * @param {object} obj
475
+ * @param {string} key
450
476
  */
451
477
 
452
478
  exports.hasKey = function hasKey(obj, key) {
@@ -493,7 +519,7 @@ exports.tick = function tick(callback) {
493
519
  /**
494
520
  * Returns true if `v` is an object that can be serialized as a primitive in
495
521
  * MongoDB
496
- * @param {Any} v
522
+ * @param {any} v
497
523
  */
498
524
 
499
525
  exports.isMongooseType = function(v) {
@@ -505,7 +531,7 @@ exports.isMongooseObject = isMongooseObject;
505
531
  /**
506
532
  * Converts `expires` options of index objects to `expiresAfterSeconds` options for MongoDB.
507
533
  *
508
- * @param {Object} object
534
+ * @param {object} object
509
535
  * @api private
510
536
  */
511
537
 
@@ -525,14 +551,14 @@ exports.expires = function expires(object) {
525
551
 
526
552
  /**
527
553
  * populate helper
528
- * @param {String} path
529
- * @param {String} select
554
+ * @param {string} path
555
+ * @param {string} select
530
556
  * @param {Model} model
531
- * @param {Object} match
532
- * @param {Object} options
533
- * @param {Any} subPopulate
534
- * @param {Boolean} justOne
535
- * @param {Boolean} count
557
+ * @param {object} match
558
+ * @param {object} options
559
+ * @param {any} subPopulate
560
+ * @param {boolean} justOne
561
+ * @param {boolean} count
536
562
  */
537
563
 
538
564
  exports.populate = function populate(path, select, model, match, options, subPopulate, justOne, count) {
@@ -645,9 +671,9 @@ function _populateObj(obj) {
645
671
  /**
646
672
  * Return the value of `obj` at the given `path`.
647
673
  *
648
- * @param {String} path
649
- * @param {Object} obj
650
- * @param {Any} map
674
+ * @param {string} path
675
+ * @param {object} obj
676
+ * @param {any} map
651
677
  */
652
678
 
653
679
  exports.getValue = function(path, obj, map) {
@@ -665,7 +691,7 @@ function getValueLookup(obj, part) {
665
691
  return obj;
666
692
  }
667
693
  let _from = obj?._doc || obj;
668
- if (_from != null && _from.isMongooseArrayProxy) {
694
+ if (_from?.isMongooseArrayProxy) {
669
695
  _from = _from.__array;
670
696
  }
671
697
  return _from instanceof Map ?
@@ -676,11 +702,11 @@ function getValueLookup(obj, part) {
676
702
  /**
677
703
  * Sets the value of `obj` at the given `path`.
678
704
  *
679
- * @param {String} path
705
+ * @param {string} path
680
706
  * @param {Anything} val
681
- * @param {Object} obj
682
- * @param {Any} map
683
- * @param {Any} _copying
707
+ * @param {object} obj
708
+ * @param {any} map
709
+ * @param {any} _copying
684
710
  */
685
711
 
686
712
  exports.setValue = function(path, val, obj, map, _copying) {
@@ -690,13 +716,16 @@ exports.setValue = function(path, val, obj, map, _copying) {
690
716
  /**
691
717
  * Returns an array of values from object `o`.
692
718
  *
693
- * @param {Object} o
719
+ * @param {object} o
694
720
  * @return {Array}
695
721
  * @api private
696
722
  */
697
723
 
698
724
  exports.object = {};
699
725
  exports.object.vals = function vals(o) {
726
+ if (o == null) {
727
+ return [];
728
+ }
700
729
  const keys = Object.keys(o);
701
730
  let i = keys.length;
702
731
  const ret = [];
@@ -712,12 +741,12 @@ exports.object.vals = function vals(o) {
712
741
  /**
713
742
  * Determine if `val` is null or undefined
714
743
  *
715
- * @param {Any} val
716
- * @return {Boolean}
744
+ * @param {any} val
745
+ * @return {boolean}
717
746
  */
718
747
 
719
748
  exports.isNullOrUndefined = function(val) {
720
- return val === null || val === undefined;
749
+ return val == null;
721
750
  };
722
751
 
723
752
  /*!
@@ -848,7 +877,7 @@ exports.buffer = {};
848
877
  * Determines if two buffers are equal.
849
878
  *
850
879
  * @param {Buffer} a
851
- * @param {Object} b
880
+ * @param {object} b
852
881
  */
853
882
 
854
883
  exports.buffer.areEqual = function(a, b) {
@@ -858,23 +887,15 @@ exports.buffer.areEqual = function(a, b) {
858
887
  if (!Buffer.isBuffer(b)) {
859
888
  return false;
860
889
  }
861
- if (a.length !== b.length) {
862
- return false;
863
- }
864
- for (let i = 0, len = a.length; i < len; ++i) {
865
- if (a[i] !== b[i]) {
866
- return false;
867
- }
868
- }
869
- return true;
890
+ return a.equals(b);
870
891
  };
871
892
 
872
893
  exports.getFunctionName = getFunctionName;
873
894
 
874
895
  /**
875
896
  * Decorate buffers
876
- * @param {Object} destination
877
- * @param {Object} source
897
+ * @param {object} destination
898
+ * @param {object} source
878
899
  */
879
900
 
880
901
  exports.decorate = function(destination, source) {
@@ -889,8 +910,8 @@ exports.decorate = function(destination, source) {
889
910
  /**
890
911
  * merges to with a copy of from
891
912
  *
892
- * @param {Object} to
893
- * @param {Object} fromObj
913
+ * @param {object} to
914
+ * @param {object} fromObj
894
915
  * @api private
895
916
  */
896
917
 
@@ -924,7 +945,7 @@ exports.mergeClone = function(to, fromObj) {
924
945
  });
925
946
  } else {
926
947
  let val = fromObj[key];
927
- if (val != null && val.valueOf && !(val instanceof Date)) {
948
+ if (val?.valueOf && !(val instanceof Date)) {
928
949
  val = val.valueOf();
929
950
  }
930
951
  if (exports.isObject(val)) {
@@ -968,9 +989,9 @@ exports.each = function(arr, fn) {
968
989
  /**
969
990
  * Rename an object key, while preserving its position in the object
970
991
  *
971
- * @param {Object} oldObj
972
- * @param {String|Number} oldKey
973
- * @param {String|Number} newKey
992
+ * @param {object} oldObj
993
+ * @param {string|number} oldKey
994
+ * @param {string|number} newKey
974
995
  * @api private
975
996
  */
976
997
  exports.renameObjKey = function(oldObj, oldKey, newKey) {
@@ -19,24 +19,25 @@ const VALID_OPTIONS = Object.freeze([
19
19
  'debug',
20
20
  'forceRepopulate',
21
21
  'id',
22
- 'timestamps.createdAt.immutable',
23
22
  'maxTimeMS',
24
23
  'objectIdGetter',
25
24
  'overwriteModels',
25
+ 'returnDocument',
26
26
  'returnOriginal',
27
27
  'runValidators',
28
28
  'sanitizeFilter',
29
29
  'sanitizeProjection',
30
30
  'selectPopulatedPaths',
31
31
  'setDefaultsOnInsert',
32
- 'skipOriginalStackTraces',
33
32
  'strict',
34
33
  'strictPopulate',
35
34
  'strictQuery',
35
+ 'timestamps.createdAt.immutable',
36
36
  'toJSON',
37
37
  'toObject',
38
38
  'transactionAsyncLocalStorage',
39
- 'translateAliases'
39
+ 'translateAliases',
40
+ 'updatePipeline'
40
41
  ]);
41
42
 
42
43
  module.exports = VALID_OPTIONS;
@@ -15,19 +15,19 @@ const modelSymbol = require('./helpers/symbols').modelSymbol;
15
15
  * const fullname = schema.virtual('fullname');
16
16
  * fullname instanceof mongoose.VirtualType // true
17
17
  *
18
- * @param {Object} options
19
- * @param {String|Function} [options.ref] if `ref` is not nullish, this becomes a [populated virtual](https://mongoosejs.com/docs/populate.html#populate-virtuals)
20
- * @param {String|Function} [options.localField] the local field to populate on if this is a populated virtual.
21
- * @param {String|Function} [options.foreignField] the foreign field to populate on if this is a populated virtual.
22
- * @param {Boolean} [options.justOne=false] by default, a populated virtual is an array. If you set `justOne`, the populated virtual will be a single doc or `null`.
23
- * @param {Boolean} [options.getters=false] if you set this to `true`, Mongoose will call any custom getters you defined on this virtual
24
- * @param {Boolean} [options.count=false] if you set this to `true`, `populate()` will set this virtual to the number of populated documents, as opposed to the documents themselves, using [`Query#countDocuments()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.countDocuments())
25
- * @param {Object|Function} [options.match=null] add an extra match condition to `populate()`
26
- * @param {Number} [options.limit=null] add a default `limit` to the `populate()` query
27
- * @param {Number} [options.skip=null] add a default `skip` to the `populate()` query
28
- * @param {Number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents.
29
- * @param {Object} [options.options=null] Additional options like `limit` and `lean`.
30
- * @param {String} name
18
+ * @param {object} options
19
+ * @param {string|Function} [options.ref] if `ref` is not nullish, this becomes a [populated virtual](https://mongoosejs.com/docs/populate.html#populate-virtuals)
20
+ * @param {string|Function} [options.localField] the local field to populate on if this is a populated virtual.
21
+ * @param {string|Function} [options.foreignField] the foreign field to populate on if this is a populated virtual.
22
+ * @param {boolean} [options.justOne=false] by default, a populated virtual is an array. If you set `justOne`, the populated virtual will be a single doc or `null`.
23
+ * @param {boolean} [options.getters=false] if you set this to `true`, Mongoose will call any custom getters you defined on this virtual
24
+ * @param {boolean} [options.count=false] if you set this to `true`, `populate()` will set this virtual to the number of populated documents, as opposed to the documents themselves, using [`Query#countDocuments()`](https://mongoosejs.com/docs/api/query.html#Query.prototype.countDocuments())
25
+ * @param {object|Function} [options.match=null] add an extra match condition to `populate()`
26
+ * @param {number} [options.limit=null] add a default `limit` to the `populate()` query
27
+ * @param {number} [options.skip=null] add a default `skip` to the `populate()` query
28
+ * @param {number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents.
29
+ * @param {object} [options.options=null] Additional options like `limit` and `lean`.
30
+ * @param {string} name
31
31
  * @api public
32
32
  */
33
33
 
@@ -134,9 +134,9 @@ VirtualType.prototype.set = function(fn) {
134
134
  /**
135
135
  * Applies getters to `value`.
136
136
  *
137
- * @param {Object} value
137
+ * @param {any} value
138
138
  * @param {Document} doc The document this virtual is attached to
139
- * @return {Any} the value after applying all getters
139
+ * @return {any} the value after applying all getters
140
140
  * @api public
141
141
  */
142
142
 
@@ -157,9 +157,9 @@ VirtualType.prototype.applyGetters = function(value, doc) {
157
157
  /**
158
158
  * Applies setters to `value`.
159
159
  *
160
- * @param {Object} value
160
+ * @param {object} value
161
161
  * @param {Document} doc
162
- * @return {Any} the value after applying all setters
162
+ * @return {any} the value after applying all setters
163
163
  * @api public
164
164
  */
165
165
 
@@ -175,7 +175,7 @@ VirtualType.prototype.applySetters = function(value, doc) {
175
175
  * Get the names of models used to populate this model given a doc
176
176
  *
177
177
  * @param {Document} doc
178
- * @return {Array<string> | null}
178
+ * @return {string[] | null}
179
179
  * @api private
180
180
  */
181
181
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mongoose",
3
3
  "description": "Mongoose MongoDB ODM",
4
- "version": "8.23.0",
4
+ "version": "9.6.3",
5
5
  "author": "Guillermo Rauch <guillermo@learnboost.com>",
6
6
  "keywords": [
7
7
  "mongodb",
@@ -20,85 +20,77 @@
20
20
  "type": "commonjs",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "bson": "^6.10.4",
24
- "kareem": "2.6.3",
25
- "mongodb": "~6.20.0",
23
+ "kareem": "3.3.0",
24
+ "mongodb": "~7.2",
26
25
  "mpath": "0.9.0",
27
- "mquery": "5.0.0",
26
+ "mquery": "6.0.0",
28
27
  "ms": "2.1.3",
29
28
  "sift": "17.1.3"
30
29
  },
31
30
  "devDependencies": {
32
- "@ark/attest": "0.53.0",
33
- "@babel/core": "7.28.5",
34
- "@babel/preset-env": "7.28.5",
31
+ "@ark/attest": "0.56.0",
32
+ "@eslint/js": "^9.39.3",
35
33
  "@mongodb-js/mongodb-downloader": "^1.0.0",
36
- "@typescript-eslint/eslint-plugin": "^8.19.1",
37
- "@typescript-eslint/parser": "^8.19.1",
34
+ "@types/node": "^20.19.0",
38
35
  "acquit": "1.4.0",
39
- "acquit-ignore": "0.2.1",
36
+ "acquit-ignore": "0.2.2",
40
37
  "acquit-require": "0.1.1",
41
- "ajv": "8.17.1",
42
- "assert-browserify": "2.0.0",
43
- "babel-loader": "8.2.5",
44
- "broken-link-checker": "^0.7.8",
45
- "buffer": "^5.6.0",
46
- "cheerio": "1.1.2",
47
- "crypto-browserify": "3.12.1",
38
+ "ajv": "8.20.0",
39
+ "c8": "11.0.0",
40
+ "cheerio": "1.2.0",
48
41
  "dox": "1.0.0",
49
- "eslint": "8.57.1",
50
- "eslint-plugin-markdown": "^5.1.0",
42
+ "eslint": "10.2.1",
51
43
  "eslint-plugin-mocha-no-only": "1.2.0",
52
- "express": "^4.19.2",
44
+ "express": "4.22.1",
53
45
  "fs-extra": "~11.3.0",
46
+ "globals": "^17.4.0",
47
+ "glob": "^13.0.6",
54
48
  "highlight.js": "11.11.1",
49
+ "linkinator": "7.x",
55
50
  "lodash.isequal": "4.5.0",
56
51
  "lodash.isequalwith": "4.4.0",
57
- "markdownlint-cli2": "^0.18.1",
58
- "marked": "15.x",
52
+ "markdownlint-cli2": "0.22.1",
53
+ "marked": "18.0.2",
59
54
  "mkdirp": "^3.0.1",
60
- "mocha": "11.7.4",
55
+ "mocha": "12.0.0-beta-10",
61
56
  "moment": "2.30.1",
62
- "mongodb-memory-server": "10.3.0",
57
+ "mongodb-client-encryption": "~7.0",
58
+ "mongodb-memory-server": "11.1.0",
63
59
  "mongodb-runner": "^6.0.0",
64
60
  "ncp": "^2.0.0",
65
- "nyc": "15.1.0",
66
- "pug": "3.0.3",
67
- "q": "1.5.1",
68
- "sinon": "21.0.0",
69
- "stream-browserify": "3.0.0",
70
- "tsd": "0.33.0",
61
+ "pug": "3.0.4",
62
+ "sinon": "21.1.2",
63
+ "tstyche": "^7.0.0",
71
64
  "typescript": "5.9.3",
72
- "uuid": "11.1.0",
73
- "webpack": "5.102.1"
65
+ "typescript-eslint": "^8.31.1",
66
+ "uuid": "14.0.0"
74
67
  },
75
68
  "directories": {
76
69
  "lib": "./lib/mongoose"
77
70
  },
78
71
  "scripts": {
79
72
  "docs:clean": "npm run docs:clean:stable",
80
- "docs:clean:stable": "rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
81
- "docs:clean:5x": "rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
82
- "docs:clean:6x": "rimraf index.html && rimraf -rf ./docs/6.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp",
73
+ "docs:clean:stable": "rm -rf index.html && rm -rf ./docs/*.html && rm -rf ./docs/api && rm -rf ./docs/tutorials/*.html && rm -rf ./docs/typescript/*.html && rm -rf ./docs/*.html && rm -rf ./docs/source/_docs && rm -rf ./tmp",
74
+ "docs:clean:5x": "rm -rf index.html && rm -rf ./docs/5.x && rm -rf ./docs/source/_docs && rm -rf ./tmp",
75
+ "docs:clean:6x": "rm -rf index.html && rm -rf ./docs/6.x && rm -rf ./docs/source/_docs && rm -rf ./tmp",
83
76
  "docs:copy:tmp": "mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && mkdirp ./tmp/docs/api && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && ncp ./docs/api ./tmp/docs/api && cp index.html ./tmp && cp docs/*.html ./tmp/docs/",
84
- "docs:copy:tmp:5x": "rimraf ./docs/5.x && ncp ./tmp ./docs/5.x",
85
- "docs:copy:tmp:6x": "rimraf ./docs/6.x && ncp ./tmp ./docs/6.x",
77
+ "docs:copy:tmp:5x": "rm -rf ./docs/5.x && ncp ./tmp ./docs/5.x",
78
+ "docs:copy:tmp:6x": "rm -rf ./docs/6.x && ncp ./tmp ./docs/6.x",
86
79
  "docs:generate": "node ./scripts/website.js",
87
80
  "docs:generate:sponsorData": "node ./scripts/loadSponsorData.js",
88
81
  "docs:test": "npm run docs:generate",
89
82
  "docs:view": "node ./scripts/static.js",
90
- "docs:prepare:publish:stable": "git checkout gh-pages && git merge master && npm run docs:generate",
83
+ "docs:prepare:publish:stable": "git checkout gh-pages && git merge master && env GENERATE_SEARCH=true npm run docs:generate",
91
84
  "docs:prepare:publish:5x": "git checkout 5.x && git merge 5.x && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && git checkout gh-pages && npm run docs:copy:tmp:5x",
92
85
  "docs:prepare:publish:6x": "git checkout 6.x && git merge 6.x && npm run docs:clean:stable && env DOCS_DEPLOY=true npm run docs:generate && mv ./docs/6.x ./tmp && git checkout gh-pages && npm run docs:copy:tmp:6x",
93
- "docs:prepare:publish:7x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/7.x && mv ./tmp ./docs/7.x",
94
- "docs:prepare:publish:8x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rimraf ./docs/8.x && mv ./tmp ./docs/8.x",
95
- "docs:check-links": "blc http://127.0.0.1:8089 -ro",
86
+ "docs:prepare:publish:7x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rm -rf ./docs/7.x && mv ./tmp ./docs/7.x",
87
+ "docs:prepare:publish:8x": "env DOCS_DEPLOY=true npm run docs:generate && git checkout gh-pages && rm -rf ./docs/8.x && mv ./tmp ./docs/8.x",
88
+ "docs:check-links": "linkinator http://127.0.0.1:8089 --silent --recurse --skip cdn.carbonads.com --skip m.servedby-buysellads.com --skip \"127\\.0\\.0\\.1:8089/docs/\\d+.x\"",
89
+ "docs:update-mongodb-links": "node ./scripts/update-mongodb-links.js",
96
90
  "lint": "eslint .",
97
91
  "lint-js": "eslint . --ext .js --ext .cjs",
98
92
  "lint-ts": "eslint . --ext .ts",
99
- "lint-md": "markdownlint-cli2 \"**/*.md\" \"#node_modules\" \"#benchmarks\"",
100
- "build-browser": "(rm ./dist/* || true) && node ./scripts/build-browser.js",
101
- "prepublishOnly": "npm run build-browser",
93
+ "lint-md": "markdownlint-cli2 \"docs/**/*.md\" \"docs/*.md\" \"*.md\"",
102
94
  "release": "git pull && git push origin master --tags && npm publish",
103
95
  "release-5x": "git pull origin 5.x && git push origin 5.x && git push origin 5.x --tags && npm publish --tag 5x",
104
96
  "release-6x": "git pull origin 6.x && git push origin 6.x && git push origin 6.x --tags && npm publish --tag 6x",
@@ -106,13 +98,18 @@
106
98
  "publish-7x": "npm publish --tag 7x",
107
99
  "create-separate-require-instance": "rm -rf ./node_modules/mongoose-separate-require-instance && node ./scripts/create-tarball && tar -xzf mongoose.tgz -C ./node_modules && mv ./node_modules/package ./node_modules/mongoose-separate-require-instance",
108
100
  "test": "mocha --exit ./test/*.test.js",
101
+ "test:ci": "npm run test -- --reporter min",
109
102
  "test-deno": "deno run --allow-env --allow-read --allow-net --allow-run --allow-sys --allow-write ./test/deno.mjs",
103
+ "test-deno:ci": "npm run test-deno -- --reporter min",
110
104
  "test-rs": "START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js",
111
- "test-tsd": "node ./test/types/check-types-filename && tsd",
105
+ "test-rs:ci": "npm run test-rs -- --reporter min",
106
+ "test:types": "tstyche",
112
107
  "setup-test-encryption": "node scripts/setup-encryption-tests.js",
113
108
  "test-encryption": "mocha --exit ./test/encryption/*.test.js",
114
- "tdd": "mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}",
115
- "test-coverage": "nyc --reporter=html --reporter=text npm test",
109
+ "test-encryption:ci": "npm run test-encryption -- --reporter min",
110
+ "tdd": "mocha --watch --inspect --recursive ./test/*.test.js --watch-files lib/**/*.js test/**/*.js",
111
+ "test-coverage": "c8 --reporter=html --reporter=text npm test",
112
+ "test-coverage:ci": "c8 --reporter=html --reporter=text npm run test:ci",
116
113
  "ts-benchmark": "cd ./benchmarks/typescript/simple && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check",
117
114
  "ts-benchmark:local": "node ./scripts/create-tarball && cd ./benchmarks/typescript/simple && rm -rf ./node_modules && npm install && npm run benchmark | node ../../../scripts/tsc-diagnostics-check",
118
115
  "attest-benchmark": "node ./benchmarks/typescript/infer.bench.mts"
@@ -120,7 +117,7 @@
120
117
  "main": "./index.js",
121
118
  "types": "./types/index.d.ts",
122
119
  "engines": {
123
- "node": ">=16.20.1"
120
+ "node": ">=20.19.0"
124
121
  },
125
122
  "bugs": {
126
123
  "url": "https://github.com/Automattic/mongoose/issues/new"
@@ -130,7 +127,6 @@
130
127
  "url": "git://github.com/Automattic/mongoose.git"
131
128
  },
132
129
  "homepage": "https://mongoosejs.com",
133
- "browser": "./dist/browser.umd.js",
134
130
  "config": {
135
131
  "mongodbMemoryServer": {
136
132
  "disablePostinstall": true
@@ -139,18 +135,5 @@
139
135
  "funding": {
140
136
  "type": "opencollective",
141
137
  "url": "https://opencollective.com/mongoose"
142
- },
143
- "tsd": {
144
- "directory": "test/types",
145
- "compilerOptions": {
146
- "esModuleInterop": false,
147
- "strict": true,
148
- "allowSyntheticDefaultImports": true,
149
- "strictPropertyInitialization": false,
150
- "noImplicitAny": false,
151
- "strictNullChecks": true,
152
- "module": "commonjs",
153
- "target": "ES2017"
154
- }
155
138
  }
156
139
  }