Releases: monarch-orm/monarch
v0.13.2
monarch-orm
0.13.0
Minor Changes
- 29d7e0c: Make query builder methods immutable — each method returns a new instance instead of mutating.
- 8c6906b: Add searchIndexes support. Use
schema.searchIndexes()for defining Atlas Search Indexes
0.12.0
Minor Changes
- d415a26: Add reusable object shapes via
object(...).shape
0.11.0
Minor Changes
-
f09d62c: Relations now use typed field references instead of plain strings for
fromandtofields.Relations also support default population options via
.options(), which apply whenever a relation is populated withtrueand can be overridden per query. -
fee15c4: The
manyrelation now supports all field type combinations: single→single, single→array, array→single, and array→array.The
refsrelation has been removed. Usemanywith an arrayfromfield instead. -
5fc2c49: Bumped minimum required MongoDB driver version to
>= 7.0.0.
0.10.0
Minor Changes
- 661154d: Add
.auto()method fordate(),uuid()andobjectId()types to set a default value - cbb395e: Add BSON types
double(),int32(),regex()anduuid() - 661154d: Add explicit initialize method and option on database to control when collection initialization happens
- 44e7e52: Throw error when an optional type is used for
array()ortuple()item - cbb395e: Remove
MonarchType.transform,MonarchType.onUpdateand removetype,pipe,dateString,createdAt,updatedAttypes - cbb395e: Add
onUpdatemethod to schemas - 661154d:
$setOnInsertvalidates full document - 742f147: Replace
createRelationswithschema.withRelationsand support merging multiple relations per schema - 8c0370e: Add custom implementations for
Filter,UpdateFilterandDistinctFiltertypes - 742f147: Support splitting schemas by adding
defineSchemasandmergeSchemafunctions which requires aSchemasclass as argument tocreateDatabase - f6d67be: Add document schema validation
- cbb395e: Rename
Schema.encode/Schema.decodetoSchema.input/Schema.output - 8bec3f8: Add
Schema.rename()method to rename fields in output
0.9.0
Minor Changes
- a9bcf1f: Replace aggregate cast method with generic param
- 5223e60: Add
findByIdAndUpdate()andfindByIdAndDelete()collection methods - a9bcf1f: Add BSON types
binary(),long()anddecimal128() - a9bcf1f: Remove
.exec()and fully support awaiting to execute query - 6177d01: Throw error when adding multiple relations/schema for a collection
Patch Changes
- 666818b: Preserve concrete type with type modifier methods
- a9bcf1f: Use prettier for formatting
- cfd39bc: Add path to error message
0.8.2
Patch Changes
- 9addbcc: fix build
0.8.1
Patch Changes
- d10fd9f: add missing distinct query
- 4121bcc: fix collisions in autogenerated variables during populations
- b771ba6: Add client metadata to mongo client returned by createClient
0.8.0
Minor Changes
- cf59f59: Export types namespace object (to support
m.string()orm.number())
0.7.1
Patch Changes
- 89871cd: Use explicit require and import exports in package.json
0.7.0
Minor Changes
- 2df301b: Hide exec from public API
- 2df301b: Add createRelations API for schema relations
- 58ffe8a: Implement only selected methods in Collection
- b513167: Use subpath exports for types and operators
- 60c2682: Add InferInput and InferOutput types to mirror find queries with omit/select and populate
- 2df301b: Rename database.db() to database.use() and make db (underlying database) field public
Patch Changes
0.6.2
Patch Changes
- 015bc8d: implement automatic promise resolution
0.6.1
Patch Changes
- 0f518de: Improve direct date support
0.6.0
Minor Changes
-
6217827: Add find cursor support
As an alternative to find(...).exec() the new find(...).cursor() returns a MongoDb cursor which implements AsyncIterator.
This allows you to consume the returned documents without loading all into memory in an array.
0.5.3
Patch Changes
- be834d2: implement population options
0.5.2
Patch Changes
- d21ff0f: fix reference chaining bug
0.5.1
Patch Changes
- 3549240: Fix populate method behavior in different edgecases
- Improve handling of different reference types in populate function
- Implement projection handling
- Update schema definitions for optional fields
- Add additional checks for relation types
- Improve error handling in populate pipeline
0.5.0
Minor Changes
- a835c5c: Add collection.findById() method
Patch Changes
- a835c5c: Add implicit default _id type to schema if none is provided: objectId().optional()
- e3eda5f: - Improved error message formatting in MonarchMany, tuple and array for better clarity.
- Fix wrong variable in MonarchDate error.
- Updated the build script in package.json.
- Modified parameter and return types in the toObjectId function.
0.4.0
Minor Changes
- b454a36: Add type.extend() method to modify type parser and updater immutably while retaining type information
- b810d21: add union and mixed types
- b454a36: Expose standalone pipe(), nullable(), optional() and defaulted() types
0.3.0
Minor Changes
- b27f314: Infer populate output types
- a75bde6: Add objectId type
- a75bde6: Add biomejs for formatting and linting
- 8de74a1: Accept mongodb db as first argument to createDatabase instead of mongodb client
- b27f314: Changed virtuals API
- a75bde6: Add support for schema relations and populate queries
Patch Changes
- a75bde6: Fix bug where omit happens before original values is passed to virtuals
- a75bde6: Refactor types to embed parser implementation in the class
- a75bde6: Hide schema methods like toData and fromData from call site
- bc13f77: Skip undefined fields during write operations in the toData method
0.2.1
Patch Changes
- a75821a: fix incorrect options for collection methods
0.2.0
Minor Changes
0.1.4
Patch Changes
0.1.3
Patch Changes
- 7a61cc1: improve update functions
0.1.2
Patch Changes
- 35be0c1: Fix minor bugs
0.1.1
Patch Changes
- 53a3fed: Implement sort, fix type inferring issue and refactor structure
v0.13.1
monarch-orm
0.13.0
Minor Changes
- 29d7e0c: Make query builder methods immutable — each method returns a new instance instead of mutating.
- 8c6906b: Add searchIndexes support. Use
schema.searchIndexes()for defining Atlas Search Indexes
0.12.0
Minor Changes
- d415a26: Add reusable object shapes via
object(...).shape
0.11.0
Minor Changes
-
f09d62c: Relations now use typed field references instead of plain strings for
fromandtofields.Relations also support default population options via
.options(), which apply whenever a relation is populated withtrueand can be overridden per query. -
fee15c4: The
manyrelation now supports all field type combinations: single→single, single→array, array→single, and array→array.The
refsrelation has been removed. Usemanywith an arrayfromfield instead. -
5fc2c49: Bumped minimum required MongoDB driver version to
>= 7.0.0.
0.10.0
Minor Changes
- 661154d: Add
.auto()method fordate(),uuid()andobjectId()types to set a default value - cbb395e: Add BSON types
double(),int32(),regex()anduuid() - 661154d: Add explicit initialize method and option on database to control when collection initialization happens
- 44e7e52: Throw error when an optional type is used for
array()ortuple()item - cbb395e: Remove
MonarchType.transform,MonarchType.onUpdateand removetype,pipe,dateString,createdAt,updatedAttypes - cbb395e: Add
onUpdatemethod to schemas - 661154d:
$setOnInsertvalidates full document - 742f147: Replace
createRelationswithschema.withRelationsand support merging multiple relations per schema - 8c0370e: Add custom implementations for
Filter,UpdateFilterandDistinctFiltertypes - 742f147: Support splitting schemas by adding
defineSchemasandmergeSchemafunctions which requires aSchemasclass as argument tocreateDatabase - f6d67be: Add document schema validation
- cbb395e: Rename
Schema.encode/Schema.decodetoSchema.input/Schema.output - 8bec3f8: Add
Schema.rename()method to rename fields in output
0.9.0
Minor Changes
- a9bcf1f: Replace aggregate cast method with generic param
- 5223e60: Add
findByIdAndUpdate()andfindByIdAndDelete()collection methods - a9bcf1f: Add BSON types
binary(),long()anddecimal128() - a9bcf1f: Remove
.exec()and fully support awaiting to execute query - 6177d01: Throw error when adding multiple relations/schema for a collection
Patch Changes
- 666818b: Preserve concrete type with type modifier methods
- a9bcf1f: Use prettier for formatting
- cfd39bc: Add path to error message
0.8.2
Patch Changes
- 9addbcc: fix build
0.8.1
Patch Changes
- d10fd9f: add missing distinct query
- 4121bcc: fix collisions in autogenerated variables during populations
- b771ba6: Add client metadata to mongo client returned by createClient
0.8.0
Minor Changes
- cf59f59: Export types namespace object (to support
m.string()orm.number())
0.7.1
Patch Changes
- 89871cd: Use explicit require and import exports in package.json
0.7.0
Minor Changes
- 2df301b: Hide exec from public API
- 2df301b: Add createRelations API for schema relations
- 58ffe8a: Implement only selected methods in Collection
- b513167: Use subpath exports for types and operators
- 60c2682: Add InferInput and InferOutput types to mirror find queries with omit/select and populate
- 2df301b: Rename database.db() to database.use() and make db (underlying database) field public
Patch Changes
0.6.2
Patch Changes
- 015bc8d: implement automatic promise resolution
0.6.1
Patch Changes
- 0f518de: Improve direct date support
0.6.0
Minor Changes
-
6217827: Add find cursor support
As an alternative to find(...).exec() the new find(...).cursor() returns a MongoDb cursor which implements AsyncIterator.
This allows you to consume the returned documents without loading all into memory in an array.
0.5.3
Patch Changes
- be834d2: implement population options
0.5.2
Patch Changes
- d21ff0f: fix reference chaining bug
0.5.1
Patch Changes
- 3549240: Fix populate method behavior in different edgecases
- Improve handling of different reference types in populate function
- Implement projection handling
- Update schema definitions for optional fields
- Add additional checks for relation types
- Improve error handling in populate pipeline
0.5.0
Minor Changes
- a835c5c: Add collection.findById() method
Patch Changes
- a835c5c: Add implicit default _id type to schema if none is provided: objectId().optional()
- e3eda5f: - Improved error message formatting in MonarchMany, tuple and array for better clarity.
- Fix wrong variable in MonarchDate error.
- Updated the build script in package.json.
- Modified parameter and return types in the toObjectId function.
0.4.0
Minor Changes
- b454a36: Add type.extend() method to modify type parser and updater immutably while retaining type information
- b810d21: add union and mixed types
- b454a36: Expose standalone pipe(), nullable(), optional() and defaulted() types
0.3.0
Minor Changes
- b27f314: Infer populate output types
- a75bde6: Add objectId type
- a75bde6: Add biomejs for formatting and linting
- 8de74a1: Accept mongodb db as first argument to createDatabase instead of mongodb client
- b27f314: Changed virtuals API
- a75bde6: Add support for schema relations and populate queries
Patch Changes
- a75bde6: Fix bug where omit happens before original values is passed to virtuals
- a75bde6: Refactor types to embed parser implementation in the class
- a75bde6: Hide schema methods like toData and fromData from call site
- bc13f77: Skip undefined fields during write operations in the toData method
0.2.1
Patch Changes
- a75821a: fix incorrect options for collection methods
0.2.0
Minor Changes
0.1.4
Patch Changes
0.1.3
Patch Changes
- 7a61cc1: improve update functions
0.1.2
Patch Changes
- 35be0c1: Fix minor bugs
0.1.1
Patch Changes
- 53a3fed: Implement sort, fix type inferring issue and refactor structure
v0.13.0
v0.12.0
v0.11.0
Minor Changes
-
f09d62c: Relations now use typed field references instead of plain strings for
fromandtofields.Relations also support default population options via
.options(), which apply whenever a relation is populated withtrueand can be overridden per query. -
fee15c4: The
manyrelation now supports all field type combinations: single→single, single→array, array→single, and array→array.The
refsrelation has been removed. Usemanywith an arrayfromfield instead. -
5fc2c49: Bumped minimum required MongoDB driver version to
>= 7.0.0.
v0.10.0
Minor Changes
- 661154d: Add
.auto()method fordate(),uuid()andobjectId()types to set a default value - cbb395e: Add BSON types
double(),int32(),regex()anduuid() - 661154d: Add explicit initialize method and option on database to control when collection initialization happens
- 44e7e52: Throw error when an optional type is used for
array()ortuple()item - cbb395e: Remove
MonarchType.transform,MonarchType.onUpdateand removetype,pipe,dateString,createdAt,updatedAttypes - cbb395e: Add
onUpdatemethod to schemas - 661154d:
$setOnInsertvalidates full document - 742f147: Replace
createRelationswithschema.withRelationsand support merging multiple relations per schema - 8c0370e: Add custom implementations for
Filter,UpdateFilterandDistinctFiltertypes - 742f147: Support splitting schemas by adding
defineSchemasandmergeSchemafunctions which requires aSchemasclass as argument tocreateDatabase - f6d67be: Add document schema validation
- 8c0370e: Add
createShapeto reuse type objects - cbb395e: Rename
Schema.encode/Schema.decodetoSchema.input/Schema.output - 8bec3f8: Add
Schema.rename()method to rename fields in output
v0.9.0
Minor Changes
- a9bcf1f: Replace aggregate cast method with generic param
- 5223e60: Add
findByIdAndUpdate()andfindByIdAndDelete()collection methods - a9bcf1f: Add BSON types
binary(),long()anddecimal128() - a9bcf1f: Remove
.exec()and fully support awaiting to execute query - 6177d01: Throw error when adding multiple relations/schema for a collection
Patch Changes
v0.8.0
v0.7.0
Minor Changes
- 2df301b: Hide exec from public API
- 2df301b: Add createRelations API for schema relations
- 58ffe8a: Implement only selected methods in Collection
- b513167: Use subpath exports for types and operators
- 60c2682: Add InferInput and InferOutput types to mirror find queries with omit/select and populate
- 2df301b: Rename database.db() to database.use() and make db (underlying database) field public