loopback v3 mixin to enable changing dotted keys before storing in MongoDB.
- 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": "#",
}
}
search: char to replace, defaults to .
.
replace: char to replace with, defaults to #
.
DEBUG='loopback:mixin:dotted-key'