public List < Response > bulk ( List < ? > objects , boolean newEdits ) { assertNotEmpty ( objects , "objects" ) ; HttpResponse response = null ; try { final String newEditsVal = newEdits ? "\"new_edits\": true, " : "\"new_edits\": false, " ; final String json = String . format ( "{%s%s%s}" , newEditsVal , "\"docs\": " , getGson ( ) . toJson ( objects ) ) ; final URI uri = buildUri ( getDBUri ( ) ) . path ( "_bulk_docs" ) . build ( ) ; response = post ( uri , json ) ; return getResponseList ( response ) ; } finally { close ( response ) ; } }
Performs bulk documents create and update request .