This mixin implements a virtual
[storage]
storage
feature which performs Ajax requests to a remote KagoDB
webapi
server.
This requires one of supported ajax drivers:
"ajax", "jquery" and "superagent".
Default driver is
request
module on node.js, and
jQuery
library on web browser environments.- Source:
Example
var opts = {
storage: 'ajax', // storage engine
ajax: 'jquery', // ajax driver
endpoint: 'http://localhost:3000/data/'
};
var collection = new KagoDB(opts);
collection.read('foo', function(err, item){
// http://localhost:3000/data/foo
});