Closed rodrigosantana777 closed 5 years ago
The version 0.6.0.M42 was enhancement with a BulkCommand. For that yours parameter must be a:
Repository repository = getRepository();
List<Author> authors = new ArrayList<Author>();
Author a1 = new Author();
a1.setName("Bulk One");
a1.setNationality("BR");
Author a2 = new Author();
a2.setName("Bulk Two");
a2.setNationality("PT");
Author a3 = new Author();
a3.setName("Bulk Three");
a3.setNationality("AU");
authors.add(a1); authors.add(a2); authors.add(a3);
Queryable q = QueryFactory.of("add", authors); // query must be named with 'add' or 'update'
int rows = repository.add(q);
assertThat(rows, is(3));
You must be invoke add
or update
repository method. whinstone-couchdb there are built-in queries: "add", "remove", "update" and "get", isn't necessary wrote in XML file.
To allow to create and update multiple documents at the same time within a single request.