Closed xjuhu closed 6 years ago
See the example. https://github.com/pofider/node-simple-odata-server#get-started
var odataServer = ODataServer("http://localhost:1337")
.model(model)
.adapter(Adapter(function(es, cb) { cb(null, db)}));
Sorry, got my example from your suggestion:
The mongo adapter can be used as
var Adapter = require('simple-odata-server-mongodb') MongoClient.connect(url, function(err, db) { odataServer.adapter(Adapter(function(cb) { cb(err, db.db('myodatadb')); })); });
Using mongodb, I have no model of data, because the documents stored are very different in structure and content. How to use this without a applying a model?
Unfortunately the model is required.
Ok, I see, this approach will not end up in a working stack for me. Thank you for your replies, anyway.
Tested in my own system, as well as on npm.runkit, always getting same error: TypeError: simpleOdataServer.adapter is not a function
Demo-Code from runkit: