Skip to content

Commit

Permalink
fix: upsert failed when return=representation is missing (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-thorel-of authored Jul 24, 2024
1 parent e4ecd86 commit 7baecde
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ default long count() {
*/
default T post(Object value) {
BulkResponse<T> post = post(List.of(value));
if (post == null) {
return null;
}
return post.stream().findFirst().orElse(null);
}

Expand Down Expand Up @@ -109,6 +112,9 @@ default BulkResponse<T> post(List<Object> values) {
*/
default T upsert(Object value) {
BulkResponse<T> upsert = upsert(List.of(value));
if (upsert == null) {
return null;
}
return upsert.stream().findFirst().orElse(null);
}

Expand All @@ -125,7 +131,7 @@ default BulkResponse<T> upsert(List<Object> values) {
/**
* Upsert multiple values with bulkMode
*
* @param values values to upsert
* @param values values to upsert
* @param options bulk options
* @return bulk response
*/
Expand Down

0 comments on commit 7baecde

Please sign in to comment.