zegal-data-extension
v1.0.0
Published
Custom data extension library
Downloads
4
Readme
data-extensions
Pluggable library to extend mongoose schemas to serve metadata and save metadata
Metadata: supported -- "data" using FieldDefinitions -- "tags": array of strings
Include this in your project package.json like this:
"dependencies": {
......
"data-extensions": "git+https://data-extensions-token:[email protected]/zegal/back-end/data-extensions.git#master"
......
},
Then initialize once
init(<mongoose DB objections>, <options>, <router>);
Sample options:
{data: { schemaName: [your name or default to "data"] }, tags: { schemaName: [your name or default to "tags"] } }
If you modify the schemaName, the effect will be
MyObject { [schemaName]: {} }
If inlineWithObject == false it will create a new collection called [schemaName]; each document in that new collection will still be: { refId: origin: data: }