Azure 関数から ArangoDB コレクションにアクセスして変更しようとしています。ドライバーが読み込まれ、データベースが選択されていますが、非同期または約束を伴う操作が機能していないようです。
Database = require('arangojs').Database;
db = new Database('http://127.0.0.1:8529');
if(!db) {
context.log('failed');
}
else {
context.log('Success');
}
db.useDatabase('test1');
collection = db.collection('test');
if(!collection) {
context.log('collection failed')
}
else {
context.log('collection success');
}
doc = {
_key: 'ahdbhdb',
name: 'foo'
};
collection.save(doc).then(
meta => context.log('Document saved:', meta._rev),
err => context.error('Failed to save document:', err)
);
内部の何かが実行されていないようです。他の機能も試しました。どんなポインタも役に立ちます。