An Arrow connector that works with the file-based version of LokiJS.
You can use
npm install appc.loki.js
or add
"appc.loki.js" : "1.0.0"
to you packacge.json file.
Register the connector in your appc.json file :
"dependencies": {
...
"connector/appc.loki.js": "^0.0.5"
},
...
Set the configuration object in your conf/default.js
file :
connectors: {
'appc.loki.js': {
db : '<nameOfYourDatabase>',
path: '/<pathToDb>/',
lokiConfiguration: {
autoload : true,
serializationMethod: 'pretty'
},
modelAutogen: true,
generateModelsFromSchema: true
}
}
Take a look at all available options and query parameters, in the API documentation section of your arrow administration. Options are available under the group appc.loki.js.
For example, if you want to persist the user model, set it such as:
var User = Arrow.Model.extend('user', {
fields: {
first_name: { type: String },
last_name: { type: String },
email: { type: String },
role: { type: String },
username: { type: String }
},
connector: ‘appc.loki.js'
});
This section is for individuals developing the LokiJS Connector and not intended for end-users.
npm install
node app.js
For development purposes use development branch only.
To test the connector, just run
npm test