Skip to content

Releases: monarch-orm/monarch

v0.13.2

14 Apr 16:58

Choose a tag to compare

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 from and to fields.

    Relations also support default population options via .options(), which apply whenever a relation is populated with true and can be overridden per query.

  • fee15c4: The many relation now supports all field type combinations: single→single, single→array, array→single, and array→array.

    The refs relation has been removed. Use many with an array from field instead.

  • 5fc2c49: Bumped minimum required MongoDB driver version to >= 7.0.0.

0.10.0

Minor Changes

  • 661154d: Add .auto() method for date(), uuid() and objectId() types to set a default value
  • cbb395e: Add BSON types double(), int32(), regex() and uuid()
  • 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() or tuple() item
  • cbb395e: Remove MonarchType.transform, MonarchType.onUpdate and remove type, pipe, dateString, createdAt, updatedAt types
  • cbb395e: Add onUpdate method to schemas
  • 661154d: $setOnInsert validates full document
  • 742f147: Replace createRelations with schema.withRelations and support merging multiple relations per schema
  • 8c0370e: Add custom implementations for Filter, UpdateFilter and DistinctFilter types
  • 742f147: Support splitting schemas by adding defineSchemas and mergeSchema functions which requires a Schemas class as argument to createDatabase
  • f6d67be: Add document schema validation
  • cbb395e: Rename Schema.encode/Schema.decode to Schema.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() and findByIdAndDelete() collection methods
  • a9bcf1f: Add BSON types binary(), long() and decimal128()
  • 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

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() or m.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

  • 2df301b: Drop MonarchPhantom
  • 2df301b: Propagate schema omit type with populate

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

  • 8a1f87b: Add schema onUpdate method
  • 8a1f87b: Add createdAtDate and updatedAtDate types

0.1.4

Patch Changes

  • 6dd7a2c: support basic operators and improve filter types
  • e2686df: fix collection types

0.1.3

Patch Changes

  • 7a61cc1: improve update functions

0.1.2

Patch Changes

0.1.1

Patch Changes

  • 53a3fed: Implement sort, fix type inferring issue and refactor structure

v0.13.1

14 Apr 11:57

Choose a tag to compare

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 from and to fields.

    Relations also support default population options via .options(), which apply whenever a relation is populated with true and can be overridden per query.

  • fee15c4: The many relation now supports all field type combinations: single→single, single→array, array→single, and array→array.

    The refs relation has been removed. Use many with an array from field instead.

  • 5fc2c49: Bumped minimum required MongoDB driver version to >= 7.0.0.

0.10.0

Minor Changes

  • 661154d: Add .auto() method for date(), uuid() and objectId() types to set a default value
  • cbb395e: Add BSON types double(), int32(), regex() and uuid()
  • 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() or tuple() item
  • cbb395e: Remove MonarchType.transform, MonarchType.onUpdate and remove type, pipe, dateString, createdAt, updatedAt types
  • cbb395e: Add onUpdate method to schemas
  • 661154d: $setOnInsert validates full document
  • 742f147: Replace createRelations with schema.withRelations and support merging multiple relations per schema
  • 8c0370e: Add custom implementations for Filter, UpdateFilter and DistinctFilter types
  • 742f147: Support splitting schemas by adding defineSchemas and mergeSchema functions which requires a Schemas class as argument to createDatabase
  • f6d67be: Add document schema validation
  • cbb395e: Rename Schema.encode/Schema.decode to Schema.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() and findByIdAndDelete() collection methods
  • a9bcf1f: Add BSON types binary(), long() and decimal128()
  • 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

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() or m.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

  • 2df301b: Drop MonarchPhantom
  • 2df301b: Propagate schema omit type with populate

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

  • 8a1f87b: Add schema onUpdate method
  • 8a1f87b: Add createdAtDate and updatedAtDate types

0.1.4

Patch Changes

  • 6dd7a2c: support basic operators and improve filter types
  • e2686df: fix collection types

0.1.3

Patch Changes

  • 7a61cc1: improve update functions

0.1.2

Patch Changes

0.1.1

Patch Changes

  • 53a3fed: Implement sort, fix type inferring issue and refactor structure

v0.13.0

13 Apr 23:52
8098956

Choose a tag to compare

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

v0.12.0

09 Apr 13:12
e88919b

Choose a tag to compare

Minor Changes

  • d415a26: Add reusable object shapes via object(...).shape

v0.11.0

08 Apr 18:13
3895fe5

Choose a tag to compare

Minor Changes

  • f09d62c: Relations now use typed field references instead of plain strings for from and to fields.

    Relations also support default population options via .options(), which apply whenever a relation is populated with true and can be overridden per query.

  • fee15c4: The many relation now supports all field type combinations: single→single, single→array, array→single, and array→array.

    The refs relation has been removed. Use many with an array from field instead.

  • 5fc2c49: Bumped minimum required MongoDB driver version to >= 7.0.0.

v0.10.0

05 Apr 10:08
8b384b9

Choose a tag to compare

Minor Changes

  • 661154d: Add .auto() method for date(), uuid() and objectId() types to set a default value
  • cbb395e: Add BSON types double(), int32(), regex() and uuid()
  • 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() or tuple() item
  • cbb395e: Remove MonarchType.transform, MonarchType.onUpdate and remove type, pipe, dateString, createdAt, updatedAt types
  • cbb395e: Add onUpdate method to schemas
  • 661154d: $setOnInsert validates full document
  • 742f147: Replace createRelations with schema.withRelations and support merging multiple relations per schema
  • 8c0370e: Add custom implementations for Filter, UpdateFilter and DistinctFilter types
  • 742f147: Support splitting schemas by adding defineSchemas and mergeSchema functions which requires a Schemas class as argument to createDatabase
  • f6d67be: Add document schema validation
  • 8c0370e: Add createShape to reuse type objects
  • cbb395e: Rename Schema.encode/Schema.decode to Schema.input/Schema.output
  • 8bec3f8: Add Schema.rename() method to rename fields in output

v0.9.0

06 Jan 10:23
756c538

Choose a tag to compare

Minor Changes

  • a9bcf1f: Replace aggregate cast method with generic param
  • 5223e60: Add findByIdAndUpdate() and findByIdAndDelete() collection methods
  • a9bcf1f: Add BSON types binary(), long() and decimal128()
  • 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

v0.8.0

27 Feb 15:14

Choose a tag to compare

Minor Changes

  • cf59f59: Export types namespace object (to support m.string() or m.number())

v0.7.0

23 Feb 12:28
46f1eac

Choose a tag to compare

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

  • 2df301b: Drop MonarchPhantom
  • 2df301b: Propagate schema omit type with populate

v0.6.2

20 Jan 11:59
2762331

Choose a tag to compare

Patch Changes

  • 015bc8d: implement automatic promise resolution