简体   繁体   中英

Bulk insert document in arangodb using java 4.1.3 driver

Is there any way to do bulk insert the documents into the collection and bulk insert for vertex and edge in graph

please share the best way to do bulk insert documents into collection and graph

using java driver 4.1.0 or 4.1.3

the best way to bulk insert documents is the method insertDocuments(Collection<T>) or importDocuments(Collection<T>) in the class ArangoCollection .

The key difference between the two methods is, that with importDocuments you can decide what happens with duplicate documents (eg update, replace existing document)

final ArangoDB arangoDB = new ArangoDB.Builder().build();
Collection<MyDocument> docs = new ArrayList<MyDocument>();
// add documents to docs

arangoDB.db().collection("myCollection").insertDocuments(docs);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM