-
registerSchema(collectionName, dbName, schema, options)
-
getCollection(db, name, config)
- supports TTL (Cache) setTTL
- supports test pattern for dbName
-
Populate
- populate doc
- populate array
- auto populate
- [_] obj.author = {_id} -> parse to object id before update
-
[_] hooks
- create/insert (pre, post) (many)
- update (pre, post) (many)
- mutate (pre, post) (many)
- c/r/u/d
- isMany
- [_] isPre/isPost
- [_] condition
- delete (pre, post)
- find (pre, post)
-
[_] debug : get mongo query
-
convert collectionName : Person -> person
-
multidb
-
[_] multiconnection
-
findOneAndUpdate parse $set -> ...
-
findById
-
[String]
-
insertMany -> parseSchema
-
updateMany -> parseCondition
-
[_] parseSchema for returnResult (consider because of performance and fake data)
- [_] find/findOne
-
[_] index
- [_] _id: unique
-
support migrate data
-
sync system
-
await for connected
-
connection/client options
-
collection options : use for get collection
- supports read/write concern
- http://mongodb.github.io/node-mongodb-native/3.6/api/Db.html#collection
-
supports case .find().count(); -> chain query
-
[_] supports $and for case .find({a: 1}).find({a: 2})
-
supports array filter
-
[_] default db name
-
[_] orm run on frontend
- [_] frontend: -> without mongodb driver :
- split code, truyen mongodb driver tu ngoai vao
- make one test
-
[_] incremental id : -> get highest
-
[_] index, majority cac kieu
-
[_] cache for high speed, case frontend ??
// Cache orm._getCollection(collection, dbName) -> Collection orm.getCollection(collection, dbName) -> Proxy orm.getModel(alias)
orm.cache
models['collection@db']
[x] object in object don't need gen [x] object id should not gen auto