-
Notifications
You must be signed in to change notification settings - Fork 481
1.0 to 1.1 Upgrade Notes and Guide
Placeholder for more readable summary of what's new in 1.1, to be expanded upon later in appropriate detail :
The autogenerated 'id' column on inserted loki objects has been renamed to '$loki'. This is probably the only breaking changed introduced, but in the future it will be less likely to conflict with objects that already have an 'id' column. If you have saved databases in 1.0 format loki should be able to load it and convert it to new id system. If your 1.0 database had user id renamed to originalId, loki should restore it with 'id' renamed to '$loki' and 'originalId' renamed back to 'id'. The next time the database is saved it will be in 1.1 format.
The Changes API enables the tracking the changes occurred in the collections since the beginning of the session, so it's possible to create a differential dataset for synchronization purposes (possibly to a remote db)
More versatile configuration of persistence method along with optional autosave and autoload capabilities. See LokiJS persistence and adapters wiki page for detailed description.
See LokiJS persistence and adapters wiki page for detailed description.
By default, when you insert and object into a LokiJS database, it refers to your object reference rather than create its own copy. If you prefer LokiJS clone its own copies you can specify collection level clone option.
For chained multisort, some examples include :
rs.compoundsort(['age', 'name']); // to sort by age and then name (both ascending)
rs.compoundsort(['age', ['name', true]); // to sort by age (ascending) and then by name (descending)
For DynamicView view, some examples include :
dv.applySortCriteria(['age', 'name']); // to sort by age and then name (both ascending)
dv.applySortCriteria(['age', ['name', true]); // to sort by age (ascending) and then by name (descending)
dv.applySortCriteria(['age', true], ['name', true]); // to sort by age (descending) and then by name (descending)
If you apply your own indexes outside of the collection constructor options, you need to call :
ensureIndex(propertyName);
or
ensureIndex(propertyName, true);
to force index to be built immediately.
Many bugfixes and a few optimizations