Skip to content

Commit

Permalink
added more integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham-gupta23 committed Aug 28, 2024
1 parent ed4158c commit e2353f7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2661,6 +2661,32 @@ void testUpdateWithUpsertOptions(final String dataStoreName) throws IOException
.build());
assertDocsAndSizeEqualWithoutOrder(
dataStoreName, iterator, "query/update_operator/updated4.json", 1);
Filter filter1 =
Filter.builder()
.expression(
RelationalExpression.of(
IdentifierExpression.of("item"),
IN,
ConstantExpression.ofStrings(List.of("shirt"))))
.build();
final Query query1 = Query.builder().setFilter(filter1).build();
final SubDocumentUpdate add =
SubDocumentUpdate.builder()
.subDocument("quantity")
.operator(ADD)
.subDocumentValue(SubDocumentValue.of(1))
.build();
final List<SubDocumentUpdate> update1 = List.of(add);
final CloseableIterator<Document> iterator1 =
collection.bulkUpdate(
query1,
update1,
UpdateOptions.builder()
.returnDocumentType(AFTER_UPDATE)
.missingDocumentStrategy(MissingDocumentStrategy.CREATE_USING_UPDATES)
.build());
assertDocsAndSizeEqualWithoutOrder(
dataStoreName, iterator1, "query/update_operator/updated5.json", 1);
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"item": "shirt",
"quantity": 1
}
]

0 comments on commit e2353f7

Please sign in to comment.