loopback v3 mixin to add support for sequential property.
npm install loopback-mixin-mongo-seq
- update
mixins
property inserver/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"
]
}
}
- add mixins property to the required model.
"mixins": {
"Seq" : {
"counterModelName": "Counter",
"counterModelDataSource": "MongoDS",
"seqPropertyName": "ID",
"step": 1,
"initialVal": 1
}
}
DEBUG='loopback:mixin:mongo-seq'