I have a collection called 'user' and 1 document in it:
{
"username": "test1",
"password": "pw1",
"id": "1"
}
I created a Foxx app and trying to follow the documentation (using 2.6.0a3). This is my controller:
var Foxx = require('org/arangodb/foxx'),
usersCollection = applicationContext.collection("user");
var usersRepo = Foxx.Repository.extend({
getAll: Foxx.createQuery(
'FOR u IN user RETURN u'
)
});
var controller = new Foxx.Controller(applicationContext);
controller.get('/', function (req, res) {
res.json(usersRepo.getAll());
});
I am getting:
{"error":"undefined is not a function"}
instead of the record list.
What am I missing?
Details on FoxxRepository
section into theMy first Foxx App
example, but it was my mistake I didn't instantiate the class. Thanks for noticing! – rollingBalls