Skip to content

Latest commit

 

History

History
71 lines (59 loc) · 1.92 KB

design.md

File metadata and controls

71 lines (59 loc) · 1.92 KB

design

  • 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 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