Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.hypertrace.core.documentstore.mongo.update;

import static org.hypertrace.core.documentstore.model.options.DataFreshness.REALTIME_FRESHNESS;
import static org.hypertrace.core.documentstore.model.options.ReturnDocumentType.NONE;
import static org.hypertrace.core.documentstore.mongo.MongoUtils.getReturnDocument;
import static org.hypertrace.core.documentstore.mongo.query.parser.MongoFilterTypeExpressionParser.getFilter;
Expand All @@ -19,6 +20,7 @@
import org.hypertrace.core.documentstore.commons.CommonUpdateValidator;
import org.hypertrace.core.documentstore.commons.UpdateValidator;
import org.hypertrace.core.documentstore.model.config.ConnectionConfig;
import org.hypertrace.core.documentstore.model.options.QueryOptions;
import org.hypertrace.core.documentstore.model.options.ReturnDocumentType;
import org.hypertrace.core.documentstore.model.options.UpdateOptions;
import org.hypertrace.core.documentstore.model.options.UpdateOptions.MissingDocumentStrategy;
Expand Down Expand Up @@ -106,13 +108,17 @@

switch (returnDocumentType) {
case BEFORE_UPDATE:
cursor = queryExecutor.aggregate(query);
cursor =
queryExecutor.aggregate(
query, QueryOptions.builder().dataFreshness(REALTIME_FRESHNESS).build());

Check warning on line 113 in document-store/src/main/java/org/hypertrace/core/documentstore/mongo/update/MongoUpdateExecutor.java

View check run for this annotation

Codecov / codecov/patch

document-store/src/main/java/org/hypertrace/core/documentstore/mongo/update/MongoUpdateExecutor.java#L111-L113

Added lines #L111 - L113 were not covered by tests
logAndUpdate(filter, updateObject, mongoUpdateOptions);
return Optional.of(cursor);

case AFTER_UPDATE:
logAndUpdate(filter, updateObject, mongoUpdateOptions);
cursor = queryExecutor.aggregate(query);
cursor =
queryExecutor.aggregate(
query, QueryOptions.builder().dataFreshness(REALTIME_FRESHNESS).build());
return Optional.of(cursor);

case NONE:
Expand Down
Loading