【发布时间】:2019-01-16 05:37:04
【问题描述】:
文档位于:
Document Manipulation · ArangoDB v3.4.1 Drivers Documentation
我看到了 collection.replace() 和 collection.update() 的文档,但没有看到 collection.save() 的文档。我知道保存功能退出,因为我正在使用它。但它没有返回预期值,我想参考文档。
我的具体问题是我想将一个文档保存到 ArangoDB 数据库并完整地取回保存的文档。到目前为止,这是我所拥有的:
async createDocument(collectionName, data) {
try {
const collection = this.db.collection(collectionName);
return collection.save(data); //I want to return the saved document
} catch(err) {
console.log(err.message, "saving failed")
}
}
【问题讨论】: