Skip to content

mohamedgomran/loopback-mixin-mongo-seq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MONGO-SEQ

loopback v3 mixin to add support for sequential property.

usage

npm install loopback-mixin-mongo-seq
  1. update mixins property in server/model-config.json:
{
  "_meta": {
    "sources": [
      "loopback/common/models",
      "loopback/server/models",
      "../common/models",
      "./models"
    ],
    "mixins": [
      "loopback/common/mixins",
      "../common/mixins",
      "../node_modules/loopback-mixin-mongo-seq/lib"
    ]
  }
}
  1. add mixins property to the required model.
  "mixins": {
     "Seq" : {
       "counterModelName": "Counter",
       "counterModelDataSource": "MongoDS",
       "seqPropertyName": "ID",
       "step": 1,
       "initialVal": 1
     }
   }

DEBUG MODE

  DEBUG='loopback:mixin:mongo-seq'

About

loopback mixin to add support for sequential property

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%