All Versions
144
Latest Version
Avg Release Cycle
20 days
Latest Release
1890 days ago

Changelog History
Page 1

  • v8.0.0 Changes

    March 30, 2018

    ๐Ÿš€ This release makes a number of improvements to Iridium's core to make it more intuitive to use and easier to reason about. Unfortunately this does involve changing aspects of how the core behaves when compared to v8.0.0-alpha.12, however this behaviour was unspec'ed and resulted in a poor user experience.

    ๐Ÿ”„ Changes

    • ๐Ÿ‘€ Making modifications to transformed object properties (or array properties) will now be reflected when calling .save() on an instance - even if you have not assigned a new value to the field - see #118 for more information.
    • โฌ†๏ธ The TDocument type is now strictly treated as a representation of the DB data structure rather than the pseudo "post-transform" format it used to represent. Previously it would sometimes represent post-transform documents and other times it would represent pre-transform documents, making it difficult to understand its purpose or reason about its behaviour. This change affects the way .insert() and .create() behave, please see the Upgrading section for more information.
    • ๐Ÿ‘Œ Support for using Instance-like objects within instance fields. The introduction of the new TransformClass and TransformClassList field decorators and the fixes for #118 make it possible to easily use class based objects to represent your collections (User { friends: Friend[] }).
    • โšก๏ธ Updated README.md file with a comprehensive example of how to leverage a number of the tools Iridium provides you with (and up-to-date code).
    • โšก๏ธ Updated MongoDB client library definitions: improved query type hints

    โšก๏ธ Updating

    1. TDocument changes

    As a result of the specification of TDocument (the first type parameter on your Instance and Model types) as the "type representation of the database's stored document", it is now no longer correct to represent the types of TDocument fields as the types that result from running transforms against them.

    Pre v8.0.0-alpha.13
    interface MyDoc { \_id?: string name: string}class MyInstance extends Instance\<MyDoc, MyInstance\> implements MyDoc { @ObjectID \_id: string @Property(String) name: string}
    
    Post v8.0.0-alpha.13

    ๐Ÿ”” Notice that the MyDoc._id field is now a mongodb.ObjectId type and that MyInstance no longer
    implements MyDoc.

    import {ObjectId} from "mongodb"interface MyDoc { \_id?: ObjectId name: string}class MyInstance extends Instance\<MyDoc, MyInstance\> { @ObjectID \_id: string @Property(String) name: string}
    

    2. .insert() and .create() changes

    In addition to the changes you should make to your Instance objects and TDocument interfaces,
    you should also curate your use of .insert() and .create() to replace instances where you pass
    untransformed data to them for insertion in raw document form.

    ๐Ÿ‘ For the time being Iridium will provide backward support for the legacy way of inserting and creating
    ๐Ÿšš documents, however in future this will be removed and you will need to either provide "DB ready" documents
    or utilize a (to be designed and implemented) API to transform an intermediary representation into a "DB ready"
    object.

    Pre v8.0.0-alpha.13
    db.User.insert({ // Will be normalized by lowercasing and trimming email: "[email protected] "})
    
    Post v8.0.0-alpha.13
    Inserting a "DB-ready" object
    db.User.insert({ email: "[email protected]"})
    
    Using an instance to generate the object
    const user = new db.User.Instance({})user.email = "[email protected] "db.User.insert(user)
    

    โšก๏ธ 3. Updated Conditions interface

    โšก๏ธ With the MongoDB client driver's types now including their own implementation of this interface with support for schemas (and the standardization of TDocument as the DB schema) we have updated the Conditions type to point to the official mongodb.FilterQuery interface.

    โšก๏ธ For all intents and purposes it should behave as it used to, however if you have been referencing Conditions in your code you will need to update it to Conditions<TDocument> to take advantage of the new schema support.

  • v8.0.0-alpha.9 Changes

    January 16, 2018

    โšก๏ธ This update adds support for TypeScript 2.6 with strict function signatures enabled.

  • v8.0.0-alpha.8 Changes

    January 13, 2018

    ๐Ÿš€ This release adds support for renaming DB fields using the new @Rename decorator as requested in #108.

    It can be used as follows:

    import \* from "iridium"@Collection("houses")export class House extends Instance\<HouseDocument, House\> implements HouseDocument { @ObjectIDpublic \_id: string; @Property(String) @Rename("house\_name") public houseName: string; }
    
  • v8.0.0-alpha.7 Changes

    January 13, 2018

    ๐Ÿš€ This release fixes an issue with passing aggregate options to the underlying MongoDB client driver in v8.0.0-alpha.6.

  • v8.0.0-alpha.6 Changes

    January 13, 2018

    ๐Ÿ“š This release adds the ability to pass options to MongoDB's underlying aggregate() method when using it through Iridum's Model class, as requested in #106. For more information on the types of options which can be passed, as well as how to use the Aggregate method, please consult the official MongoDB documentation.

  • v8.0.0-alpha.5 Changes

    January 13, 2018

    ๐Ÿš€ This release adds a regression test to prevent the type of issue described in #96 as well as adding various BSON type helpers (like Iridium.toObjectID) for Numeric types (#103).

  • v8.0.0-alpha.14

    April 07, 2018
  • v8.0.0-alpha.13 Changes

    March 30, 2018

    ๐Ÿš€ This release makes a number of improvements to Iridium's core to make it more intuitive to use and easier to reason about. Unfortunately this does involve changing aspects of how the core behaves when compared to v8.0.0-alpha.12, however this behaviour was unspec'ed and resulted in a poor user experience.

    ๐Ÿ”„ Changes

    • ๐Ÿ‘€ Making modifications to transformed object properties (or array properties) will now be reflected when calling .save() on an instance - even if you have not assigned a new value to the field - see #118 for more information.
    • โฌ†๏ธ The TDocument type is now strictly treated as a representation of the DB data structure rather than the pseudo "post-transform" format it used to represent. Previously it would sometimes represent post-transform documents and other times it would represent pre-transform documents, making it difficult to understand its purpose or reason about its behaviour. This change affects the way .insert() and .create() behave, please see the Upgrading section for more information.
    • ๐Ÿ‘Œ Support for using Instance-like objects within instance fields. The introduction of the new TransformClass and TransformClassList field decorators and the fixes for #118 make it possible to easily use class based objects to represent your collections (User { friends: Friend[] }).
    • โšก๏ธ Updated README.md file with a comprehensive example of how to leverage a number of the tools Iridium provides you with (and up-to-date code).
    • โšก๏ธ Updated MongoDB client library definitions: improved query type hints

    โšก๏ธ Updating

    1. TDocument changes

    As a result of the specification of TDocument (the first type parameter on your Instance and Model types) as the "type representation of the database's stored document", it is now no longer correct to represent the types of TDocument fields as the types that result from running transforms against them.

    Pre v8.0.0-alpha.13
    interface MyDoc { \_id?: string name: string}class MyInstance extends Instance\<MyDoc, MyInstance\> implements MyDoc { @ObjectID \_id: string @Property(String) name: string}
    
    Post v8.0.0-alpha.13

    ๐Ÿ”” Notice that the MyDoc._id field is now a mongodb.ObjectId type and that MyInstance no longer
    implements MyDoc.

    import {ObjectId} from "mongodb"interface MyDoc { \_id?: ObjectId name: string}class MyInstance extends Instance\<MyDoc, MyInstance\> { @ObjectID \_id: string @Property(String) name: string}
    

    2. .insert() and .create() changes

    In addition to the changes you should make to your Instance objects and TDocument interfaces,
    you should also curate your use of .insert() and .create() to replace instances where you pass
    untransformed data to them for insertion in raw document form.

    ๐Ÿ‘ For the time being Iridium will provide backward support for the legacy way of inserting and creating
    ๐Ÿšš documents, however in future this will be removed and you will need to either provide "DB ready" documents
    or utilize a (to be designed and implemented) API to transform an intermediary representation into a "DB ready"
    object.

    Pre v8.0.0-alpha.13
    db.User.insert({ // Will be normalized by lowercasing and trimming email: "[email protected] "})
    
    Post v8.0.0-alpha.13
    Inserting a "DB-ready" object
    db.User.insert({ email: "[email protected]"})
    
    Using an instance to generate the object
    const user = new db.User.Instance({})user.email = "[email protected] "db.User.insert(user)
    

    โšก๏ธ 3. Updated Conditions interface

    โšก๏ธ With the MongoDB client driver's types now including their own implementation of this interface with support for schemas (and the standardization of TDocument as the DB schema) we have updated the Conditions type to point to the official mongodb.FilterQuery interface.

    โšก๏ธ For all intents and purposes it should behave as it used to, however if you have been referencing Conditions in your code you will need to update it to Conditions<TDocument> to take advantage of the new schema support.

  • v8.0.0-alpha.12 Changes

    February 06, 2018

    ๐Ÿš€ This release adds support for MongoDB's 3.x client driver, with the various new features provided by it. For most users, this should be a drop-in replacement with Iridium abstracting the API changes, however if you are interacting with the underling MongoDB connection objects, you may need to make some changes to your code.

    ๐Ÿ”„ Changes

    • Iridium.Core.connection is now a MongoDB.MongoClient object rather than the original MongoDB.Db object.
    • Iridium.Core.db now exposes the MongoDB.Db object if you require it.
    • โšก๏ธ Updated the URL builder to meet the requirements of the MongoDB 3 client driver
    • โšก๏ธ Updated the Iridium.Model.update method to explicitly call MongoDB.collection.replaceOne when you provide it with a document that isn't composed entirely of atomic changes. It will also throw an error if you provide such a document (for replacement) and specify { multi: true } in your options.
  • v8.0.0-alpha.11 Changes

    February 06, 2018

    ๐Ÿš€ This release updates the default Instance implementation to call the onCreate hook when an instance is first being saved to the DB - thanks @CatGuardian for the PR.