Your function test_arango_query
doesn't use a callback. sync
only works with functions that use a callback. It needs to know when the data is ready to return it from .sync()
, if your function never calls the callback, then sync
can't ever return a result.
Update your function to call a callback function when you want it to return:
function test_arango_query(callback) {
var db = arango.Connection("http://localhost:8529");
db.database.list().done(function(res) {
console.log("Databases: %j", res);
callback('something');
});
}