有没有办法将文档批量插入到图集中的顶点和边缘的集合和批量插入中
请分享批量插入文档到收藏和图表的最佳方式
使用java驱动4.1.0或4.1.3
答案 0 :(得分:2)
批量插入文档的最佳方法是在类insertDocuments(Collection<T>)
中使用方法importDocuments(Collection<T>)
或ArangoCollection
。
这两种方法的主要区别在于,使用importDocuments
可以决定重复文档会发生什么(例如更新,替换现有文档)
final ArangoDB arangoDB = new ArangoDB.Builder().build();
Collection<MyDocument> docs = new ArrayList<MyDocument>();
// add documents to docs
arangoDB.db().collection("myCollection").insertDocuments(docs);