- Export constants under main entry
- Improve typings
- Fix
DatabaseHookError
constructor params
- Add
ExtendedCollection
with additional methodattachHook()
with the same functionality asMongol.attachDatabaseHook()
- Add
Mongol.collection()
andMongol.promisifiedCollection()
to fetchExtendedCollection
Mongol.attachDatabaseHook()
now returns the original collection object asExtendedCollection
- Fix accidentally remove fields named "type"
- Fix missing files when deploying to NPM
- Fix
Mongol
always overwrites its constructor options
Mongol.setSchema()
returns actually used JSON schema- Add Mongol constructor options
MongolOptions
, with customMongoClient
options support - Deprecate database hook "error" handler and promote
DatabaseHookError
- Internally use
Mongol.client.isConnected()
instead ofMongol.db
to check connection state - Improve some generic type names
- Improve documentation
- Add
CrudOp
- abbreviation forCrudOperation
- Move
Mongol
to a separate file named/src/mongol.ts
- Export all type definitions together with
Mongol
under@albert-team/mongol
- Use
createdAt/created_at
in replace operations in builtin timestamp hook - Remove meaningless tests
- Rename
autoTimestamp()
tocreateTimestampHook()
. From now on, all builtin hook factories will havecreate*Hook()
format.
- Fix a typo in
/src/utils.ts
- Add builtin database hook factory
autoTimestamp()
- Add parsed arguments into database hook context for "before" handler
- Improve some type names and signatures
- Convert array constants to ES6 sets
- Auto-connect with
Mongol.promisifiedDatabase
- Add support for database hook/trigger
- Reorganize project
- Fix
SchemaOptions.ignoreType
won't work withoutignoreUnsupportedKeywords
being true - Set
Mongol.db = undefined
on disconnected