Skip to content

ninja-labs-tech/loopback-mixin-dotted-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loopback-mixin-dotted-key Build Status

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'

About

mixin to replcae dotted keys in loopback before storing in MongoDB

Resources

License

Stars

Watchers

Forks

Packages

No packages published