1.0.2 • Published 5 years ago
loopback-mixin-dotted-key v1.0.2
loopback-mixin-dotted-key
loopback v3 mixin to enable changing dotted keys before storing in MongoDB.
usage
- install via npm.
npm install loopback-mixin-dotted-key
- update
server.js
to load mixin.
const DottedKeysReplace = require('loopback-mixin-dotted-key');
DottedKeysReplace(app);
- add mixins property to the required model.
"mixins": {
"DottedKeysReplace" : {
"search": ".",
"replace": "#",
}
}
options
search: char to replace, defaults to .
.
replace: char to replace with, defaults to #
.
DEBUG MODE
DEBUG='loopback:mixin:dotted-key'