#Changelog
- Fix
dropDatabase
when database is corrupted
- Update dependencies
- Update to NeDB 3
- Remove compatibility for Node.js below 12
- Remove RNLocalMongoClient
- Remove experimental readOnly mode for nedb client
- Use async methods in nedb client
- Remove documentClass method and static method on BaseDocument, EmbeddedDocument and Document
- Change how types are tested with instanceof instead of documentClass method which changes instanciation a bit Rename _migrateCollection static method to migrateCollection (not private)
- Internalized path.join to avoid dependency with path module polyfill
- Rename CamoError to FollicleError
- Remove depd dependency
- Fixed a migration issue when there are constraints on the migrated fields
- Switched to
@seald-io/nedb@^2.0.0
rather thannedb@^1.8.0
since it is unmaintained
- Updating dependencies
- Removing peer dependencies
- Release on public NPM registry
- fix bug in how arrays of EmbeddedDocuments are validated which could skip validation and / or throw internal unexpected errors
- fix bug in the layer to track if there are still ongoing tasks which threw at close time if one of the tasks failed;
- fix bug in the layer to track if there are still ongoing tasks which triggered unhandled rejections;
- move layer to track if there are still ongoing tasks to the Client class;
- define the tasks as methods of the Document class rather than methods of the various Client classes, because there
are
async
pre-hook and post-hooks in the Document class which were previously ignored which induced race conditions. - fix
Document#createIndex
method which is actuallyasync
; - fix
DatabaseClient#dropDatabase
which didn't work with NeDB and ReactNativeLocalMongo;
- NeDBClient & ReactNativeLocalMongoClient:
- add a layer to track if there are still ongoing tasks;
- wait for those tasks to be executed before closing the database;
- queue
persistCachedDatabase
in database's built-in executor to avoid internal race conditions; - wait for the database's built-in executor to be drained.
- ReactNativeLocalMongoClient: asyncify
- update dependencies
- actually fix deprecated import of react-native async-storage
- fix deprecated import of react-native async-storage
- fix crash when an EmbeddedDocument is directly a non-required property of a Document
- fix package build
- update dependencies
- less useless files in package
- remove lodash as a dependency
- nedb does not expose any API to close a Datastore, so that the close didn't do anything. Implemented precautions to
- persist cached database & compact (done via persistCachedDatabase);
- stop further compactions (done via stopAutocompaction);
- remove references to datastores so that they cannot be used without being re-loaded.
- bump
dependencies
&devDependencies
;
- a call to
save
in nedbclient would only$set
the additions using nedb's modifiers (https://github.com/louischatriot/nedb#updating-documents), now it saves the whole document again. - migrations now allow to rename a field without leaving the old field lying in the Datastore
- add way to give custom nedb options to
nedbclient
to matchreactlocalmongoclient
signature; - add a
readOnly
option tonedbclient
;
- asyncify all functions in
nedbclient
; - convert
that
tothis
innedbclient
by switching to arrow functions; - switch
.gitlab-ci.yml
tonode:10
instead ofnode:latest
; - convert useless
let
toconst
innedbclient
; - bump
devDependencies
;
- fix bug in
dropDatabase
when not in memory which would crash when removing file (because of athis
improperly used inside of afunction
);
- add a way to give custom
react-native-nedb
options toreactlocalmongoclient
such asAsyncStorage
- added default empty queries to
mongoclient
.
- [BREAKING] dynamically connect to a database rather than a static connection (mostly to improve testing) with a factory function pattern;
- added migrations
- [BREAKING] changed how the collections are stored with NeDB: rather than giving a file path, a directory path is given and the name of each collection is given by the name of the class;
#Old changelog (camo)
Bugfixes:
Bugfixes:
- Merged PR that prevents methods from being serialized in
toJSON()
(#79)
Features:
- Updated README to warn about frequently changing API
- Added Contributing and Contact sections to README Bugfixes:
- Fixed issue that prevented
save()
from being aborted whenPromise.reject
was returned in a hook (#57) - Replaced all
.id
references to._id
in README - Fixed issue where schema types
Array
and[]
were not properly being validated (#53) - In README, changed an incorrect reference of
.findMany()
to.find()
(#54) - Fixed issue where updated nested data wasn't returned when using
.findOneAndUpdate()
with NeDB (#55)
Features:
- Added support for sorting with multiple keys (#22)
- Added support for accepting strings as Dates (#46)
- Deprecated
loadMany
,loadOne
,loadOneAndUpdate
, andloadOneAndDelete
in favor offind
,findOne
,findOneAndUpdate
, andfindOneAndDelete
, respectively (#37) - Added documentation on transpiler support for Camo Bugfixes:
- Changed 'schema({})' to 'this.schema({})' in README since original throws ReferenceError (#52)
Bugfixes:
- Fixed issue with saving/loading deeply nested embedded documents (#35)
- Removed
_id
and_schema._id
fromEmbeddedDocument
class (#31) - Allow user to specify a custom _id (#29)
Features:
- Added new
ValidationError
object Bugfixes: - Improved some validation tests
- Fixed min validation
- Fixed validation for array of embedded documents
- Moved
collectionName
method toBaseDocument
soEmbeddedDocument
can use it (#26) - Deprecated
id
alias from document object (#20) - Fixed serialization test for MongoDB IDs
Bugfixes:
- Fixed issue with running 'canonicalize' tests on travis-ci
Bugfixes:
- Removed unused
harmony-reflect
dependency
Features:
--harmony-proxies
flag is no longer required- Class names now declared in
static collectionName()
. Declaration through constructor is depracated (#16) - Added new
required
schema property (#18 and #19) Bugfixes: - Fixed some inconsistencies with
id
aliasing (partial fix to #20)
Features:
- Added support for setting the 'unique' index on a field
- Added support for specifying which reference fields should be populated in
loadOne()
andloadMany()
Bugfixes: - Fixed issue in
isNativeId
where we weren't returning a proper Boolean.
Features:
- Added support for testing in travis-ci.org Bugfixes:
- Fixed issue #10 where IDs in queries had to be ObjectId. Now string IDs are automatically cast to ObjectId.
Features:
- Added support for
sort
option on.loadMany()
- Added support for
limit
option on.loadMany()
- Added support for
skip
option on.loadMany()
- Added
.toJSON()
toDocument
andEmbeddedDocument
for serialization - Updated 'engines' property to '>=2.0.0' in package.json Bugfixes:
- Fixed issue #14 where
Document
s couldn't be initialized with an array ofEmbeddedDocument
objects via.create()
Features:
- Added support for custom validation on schemas via
validate
property Bugfixes: - Fixed issue #9 where no member values could be set as
undefined
Bugfixes:
- Fixed issue #8 where virtual setters were not used on initialization
loadMany()
now loads all documents if query is not provideddeleteMany()
now deletes all documents if query is not provided
Features:
- Added
loadOneAndUpdate
static method toDocument
class - Added
loadOneAndDelete
static method toDocument
class
Features:
- Added in-memory support for NeDB
- Added regex validator to
Document
Bugfixes:
- Fixed issue where
schema()
wasn't canonicalizing schema definitions. - Updated README to show an example of using
schema()
.
Features:
- README additions
- New test for overriding schemas
Bugfixes:
- Fixed issue where _id was being reassigned in Mongo, and fixed issue with populating references in Mongo.
- Fixed issue with Mongo driver where reference validation checks failed.
- Fixed test Issues.#4 for when running in Mongo.
Bugfixes:
- Fixed issue where
Date
s were saved in different formats (integers,Date
objects, etc). Added way to canonicalize them so all dates look the same in the DB and are also loaded as Date objects.
Bugfixes:
- Fixed issue in
.loadMany()
where references in arrays were getting loaded too many times. (#4).- Added test in issues.test.js
- Fixed issue in
.loadMany()
where muliple references to the same object were only getting loaded once. (#5).- Added test in issues.test.js
- Version bump, thanks to NPM.
Bugfixes:
- Fixed validation and referencing so
Document
s can be referenced by their object or ID.
Features:
- Exposed
getClient()
method for retrieving the active Camo client. - Added
options
parameter toconnect()
so options can be passed to backend DB client. - Static method
Document.fromData()
is now a private helper method. Static method.create()
should be used instead.
Bugfixes:
- In
Document._fromData()
, added check to see if ID exists before assigning - Changed
BaseDocument._fromData()
so it returns data in same form as it was passed.- i.e. Array of data returned as array, single object returned as single object.
- Fixed bug where assigning an array of Documents in
.create()
lost the references. - Stopped using the depracated
_.extend()
alias. Now using_.assign()
instead. (#1). - Fixed
get
andset
issue with Proxy (#3).
Features:
- Changed
.isModel()
to.isDocument()
. - Added
EmbeddedDocument
class and tests.- The following features work with
EmbeddedDocument
s: = Schema options: default, min, max, type, choices = All types supported inDocument
also work inEmbeddedDocument
= Array ofEmbeddedDocument
s = Pre/post validate, save, and delete hooks
- The following features work with
Bugfix:
- Added forked version of
harmony-reflect
. Only difference is it uses a global to ensure it runs only once.
Bugfix:
- Moved Proxy/Reflect shim to index. Seems to fix problem where shim broke Proxies (even worse).
Features:
- Added support for MongoDB using node-mongodb-native as the backend.
- Added
.toCanonicalId()
and.isNativeId()
toDatabaseClient
and its child classes.
- README fix.
Features:
- Added the following Document hooks:
preValidate()
postValidate()
preSave()
postSave()
preDelete()
postDelete()
Features:
- Updated README to include 'javascript' declaration for syntax highlighting.
- Added 'homepage' to package.json.
- Added 'repository' to package.json.
- Added 'email' to 'author' in package.json.
Features:
- Minor version bump.
- No longer need to use
.schema()
in Document subclass. Now all public variables (any variable not starting with an underscore) are used in the schema. - Implemented
.count()
in Document, Client, and NeDbClient to get Document count without retrieving data. - Added
options
parameter to.loadOne()
and.loadMany()
to specify whether references should be populated. - Added support for circular dependencies.
- Added README.
- Added CHANGELOG.
Initial release.