From da79a5faac632c140a1aa13b65700ad290f079c7 Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Mon, 23 Dec 2024 13:21:51 -0500 Subject: [PATCH 1/6] add regex --- .../model/search/RegexSearchOperator.java | 43 ++++++++++++ .../SearchConstructibleBsonElement.java | 7 +- .../client/model/search/SearchOperator.java | 30 +++++++++ .../AggregatesSearchIntegrationTest.java | 4 +- .../model/search/SearchOperatorTest.java | 67 +++++++++++++++++++ .../scala/model/search/SearchOperator.scala | 21 ++++++ .../mongodb/scala/model/search/package.scala | 8 +++ 7 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java diff --git a/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java b/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java new file mode 100644 index 00000000000..a54889cbc47 --- /dev/null +++ b/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java @@ -0,0 +1,43 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.mongodb.client.model.search; + +import com.mongodb.annotations.Beta; +import com.mongodb.annotations.Reason; +import com.mongodb.annotations.Sealed; + +/** + * @see SearchOperator#regex(SearchPath, String) + * @see SearchOperator#regex(Iterable, Iterable) + * @since 5.3 + */ + +@Sealed +@Beta(Reason.CLIENT) +public interface RegexSearchOperator extends SearchOperator { + @Override + RegexSearchOperator score(SearchScore modifier); + + /** + * Creates a new {@link RegexSearchOperator} that uses allowAnalyzedField. + * + * @param isAllowed The boolean to run the query against an analyzed field. + * @return A new {@link RegexSearchOperator}. + * + * @mongodb.atlas.manual atlas-search/allowAnalyzedField/ allowAnalyzedField mappings + */ + RegexSearchOperator allowAnalyzedField(boolean isAllowed); +} diff --git a/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java b/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java index 8f0b1e510c5..6560de7f9cd 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java +++ b/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java @@ -31,7 +31,7 @@ final class SearchConstructibleBsonElement extends AbstractConstructibleBsonElement implements MustCompoundSearchOperator, MustNotCompoundSearchOperator, ShouldCompoundSearchOperator, FilterCompoundSearchOperator, ExistsSearchOperator, TextSearchOperator, AutocompleteSearchOperator, - NumberNearSearchOperator, DateNearSearchOperator, GeoNearSearchOperator, + NumberNearSearchOperator, DateNearSearchOperator, GeoNearSearchOperator, RegexSearchOperator, ValueBoostSearchScore, PathBoostSearchScore, ConstantSearchScore, FunctionSearchScore, GaussSearchScoreExpression, PathSearchScoreExpression, FacetSearchCollector, @@ -88,6 +88,11 @@ public TextSearchOperator synonyms(final String name) { }); } + @Override + public RegexSearchOperator allowAnalyzedField(final boolean isAllowed) { + return newWithAppendedValue("allowAnalyzedField", notNull("isAllowed", isAllowed)); + } + @Override public AutocompleteSearchOperator anyTokenOrder() { return newWithAppendedValue("tokenOrder", "any"); diff --git a/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java b/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java index 9234db91c51..b8bb561cf5c 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java +++ b/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java @@ -292,6 +292,36 @@ static GeoNearSearchOperator near(final Point origin, final Number pivot, final .append("pivot", notNull("pivot", pivot))); } + /** + * Returns a {@link SearchOperator} that performs a search using a regular expression. + * + * @param path The field to be searched. + * @param query The string to search for. + * @return The requested {@link SearchOperator}. + * @mongodb.atlas.manual atlas-search/regex/ regex operator + */ + static RegexSearchOperator regex(final SearchPath path, final String query) { + return regex(singleton(notNull("path", path)), singleton(notNull("query", query))); + } + + /** + * Returns a {@link SearchOperator} that performs a search using a regular expression. + * + * @param paths The non-empty fields to be searched. + * @param queries The non-empty strings to search for. + * @return The requested {@link SearchOperator}. + * @mongodb.atlas.manual atlas-search/regex/ regex operator + */ + static RegexSearchOperator regex(final Iterable paths, final Iterable queries) { + Iterator pathIterator = notNull("paths", paths).iterator(); + isTrueArgument("paths must not be empty", pathIterator.hasNext()); + Iterator queryIterator = notNull("queries", queries).iterator(); + isTrueArgument("queries must not be empty", queryIterator.hasNext()); + String firstQuery = queryIterator.next(); + return new SearchConstructibleBsonElement("phrase", new Document("path", combineToBsonValue(pathIterator, false)) + .append("query", queryIterator.hasNext() ? queries : firstQuery)); + } + /** * Creates a {@link SearchOperator} from a {@link Bson} in situations when there is no builder method that better satisfies your needs. * This method cannot be used to validate the syntax. diff --git a/driver-core/src/test/functional/com/mongodb/client/model/search/AggregatesSearchIntegrationTest.java b/driver-core/src/test/functional/com/mongodb/client/model/search/AggregatesSearchIntegrationTest.java index 29de80dda32..3644d4f6da1 100644 --- a/driver-core/src/test/functional/com/mongodb/client/model/search/AggregatesSearchIntegrationTest.java +++ b/driver-core/src/test/functional/com/mongodb/client/model/search/AggregatesSearchIntegrationTest.java @@ -82,6 +82,7 @@ import static com.mongodb.client.model.search.SearchOperator.exists; import static com.mongodb.client.model.search.SearchOperator.near; import static com.mongodb.client.model.search.SearchOperator.numberRange; +import static com.mongodb.client.model.search.SearchOperator.regex; import static com.mongodb.client.model.search.SearchOperator.text; import static com.mongodb.client.model.search.SearchOptions.searchOptions; import static com.mongodb.client.model.search.SearchPath.fieldPath; @@ -608,7 +609,8 @@ private static Stream searchAndSearchMetaArgs() { dateRange(fieldPath("fieldName6")) .lte(Instant.ofEpochMilli(1)), near(0, 1.5, fieldPath("fieldName7"), fieldPath("fieldName8")), - near(Instant.ofEpochMilli(1), Duration.ofMillis(3), fieldPath("fieldName9")) + near(Instant.ofEpochMilli(1), Duration.ofMillis(3), fieldPath("fieldName9")), + regex(fieldPath("fieldName11"), "term7") )) .minimumShouldMatch(1) .mustNot(singleton( diff --git a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java index c0ea645fb73..f4fbd3498f0 100644 --- a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java +++ b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java @@ -19,6 +19,7 @@ import com.mongodb.client.model.geojson.Point; import com.mongodb.client.model.geojson.Position; import org.bson.BsonArray; +import org.bson.BsonBoolean; import org.bson.BsonDateTime; import org.bson.BsonDocument; import org.bson.BsonDouble; @@ -581,6 +582,72 @@ void near() { ); } + @Test + void regex() { + assertAll( + () -> assertThrows(IllegalArgumentException.class, () -> + // queries must not be empty + SearchOperator.regex(singleton(fieldPath("fieldName")), emptyList()) + ), + () -> assertThrows(IllegalArgumentException.class, () -> + // paths must not be empty + SearchOperator.regex(emptyList(), singleton("term")) + ), + () -> assertEquals( + new BsonDocument("phrase", + new BsonDocument("path", fieldPath("fieldName").toBsonValue()) + .append("query", new BsonString("term")) + ), + SearchOperator.regex( + fieldPath("fieldName"), + "term") + .toBsonDocument() + ), + () -> assertEquals( + new BsonDocument("phrase", + new BsonDocument("path", new BsonArray(asList( + fieldPath("fieldName").toBsonValue(), + wildcardPath("wildc*rd").toBsonValue()))) + .append("query", new BsonArray(asList( + new BsonString("term1"), + new BsonString("term2")))) + ), + SearchOperator.regex( + asList( + fieldPath("fieldName"), + wildcardPath("wildc*rd")), + asList( + "term1", + "term2")) + .toBsonDocument() + ), + () -> assertEquals( + new BsonDocument("phrase", + new BsonDocument("path", fieldPath("fieldName").toBsonValue()) + .append("query", new BsonString("term")) + .append("allowAnalyzedField", new BsonBoolean(true)) + ), + SearchOperator.regex( + singleton(fieldPath("fieldName")), + singleton("term")) + .allowAnalyzedField(true) + .toBsonDocument() + ), + () -> assertEquals( + new BsonDocument("phrase", + new BsonDocument("path", fieldPath("fieldName").toBsonValue()) + .append("query", new BsonString("term")) + .append("allowAnalyzedField", new BsonBoolean(false)) + ), + SearchOperator.regex( + singleton(fieldPath("fieldName")), + singleton("term")) + .allowAnalyzedField(false) + .toBsonDocument() + ) + ); + } + private static SearchOperator docExamplePredefined() { return SearchOperator.exists( fieldPath("fieldName")); diff --git a/driver-scala/src/main/scala/org/mongodb/scala/model/search/SearchOperator.scala b/driver-scala/src/main/scala/org/mongodb/scala/model/search/SearchOperator.scala index 90f27092ebc..333052a98d8 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/model/search/SearchOperator.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/model/search/SearchOperator.scala @@ -228,6 +228,27 @@ object SearchOperator { def near(origin: Point, pivot: Number, paths: Iterable[_ <: FieldSearchPath]): GeoNearSearchOperator = JSearchOperator.near(origin, pivot, paths.asJava) + /** + * Returns a `SearchOperator` that performs a search using a regular expression. + * + * @param path The field to be searched. + * @param query The string to search for. + * @return The requested `SearchOperator`. + * @see [[https://www.mongodb.com/docs/atlas/atlas-search/regex/ regex operator]] + */ + def regex(path: SearchPath, query: String): RegexSearchOperator = JSearchOperator.regex(path, query) + + /** + * Returns a `SearchOperator` that performs a search using a regular expression. + * + * @param paths The non-empty fields to be searched. + * @param queries The non-empty strings to search for. + * @return The requested `SearchOperator`. + * @see [[https://www.mongodb.com/docs/atlas/atlas-search/regex/ regex operator]] + */ + def regex(paths: Iterable[_ <: SearchPath], queries: Iterable[String]): RegexSearchOperator = + JSearchOperator.regex(paths.asJava, queries.asJava) + /** * Creates a `SearchOperator` from a `Bson` in situations when there is no builder method that better satisfies your needs. * This method cannot be used to validate the syntax. diff --git a/driver-scala/src/main/scala/org/mongodb/scala/model/search/package.scala b/driver-scala/src/main/scala/org/mongodb/scala/model/search/package.scala index 557060324cd..1fd1cbb7f13 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/model/search/package.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/model/search/package.scala @@ -127,6 +127,14 @@ package object search { @Beta(Array(Reason.CLIENT)) type AutocompleteSearchOperator = com.mongodb.client.model.search.AutocompleteSearchOperator + /** + * @see `SearchOperator.regex(String, SearchPath)` + * @see `SearchOperator.regex(Iterable, Iterable)` + */ + @Sealed + @Beta(Array(Reason.CLIENT)) + type RegexSearchOperator = com.mongodb.client.model.search.RegexSearchOperator + /** * A base for a [[NumberRangeSearchOperatorBase]] which allows creating instances of this operator. * This interface is a technicality and does not represent a meaningful element of the full-text search query syntax. From e560e43b3beb527caa3c5b198a0129967b6a8cf4 Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Fri, 10 Jan 2025 11:16:28 -0500 Subject: [PATCH 2/6] update --- .../com/mongodb/client/model/search/RegexSearchOperator.java | 4 ++-- .../client/model/search/SearchConstructibleBsonElement.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java b/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java index a54889cbc47..920c2df442a 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java +++ b/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java @@ -34,10 +34,10 @@ public interface RegexSearchOperator extends SearchOperator { /** * Creates a new {@link RegexSearchOperator} that uses allowAnalyzedField. * - * @param isAllowed The boolean to run the query against an analyzed field. + * @param allowAnalyzedField Must be set to true if the query is run against an analyzed field. * @return A new {@link RegexSearchOperator}. * * @mongodb.atlas.manual atlas-search/allowAnalyzedField/ allowAnalyzedField mappings */ - RegexSearchOperator allowAnalyzedField(boolean isAllowed); + RegexSearchOperator allowAnalyzedField(boolean allowAnalyzedField); } diff --git a/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java b/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java index 6560de7f9cd..b6255f95a1b 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java +++ b/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java @@ -89,8 +89,8 @@ public TextSearchOperator synonyms(final String name) { } @Override - public RegexSearchOperator allowAnalyzedField(final boolean isAllowed) { - return newWithAppendedValue("allowAnalyzedField", notNull("isAllowed", isAllowed)); + public RegexSearchOperator allowAnalyzedField(final boolean allowAnalyzedField) { + return newWithAppendedValue("allowAnalyzedField", allowAnalyzedField); } @Override From 05070a4af92e1c602b31cb1512746ded7c8682d7 Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Fri, 10 Jan 2025 15:13:44 -0500 Subject: [PATCH 3/6] fix typo --- .../com/mongodb/client/model/search/SearchOperator.java | 2 +- .../mongodb/client/model/search/SearchOperatorTest.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java b/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java index b8bb561cf5c..71e656fb512 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java +++ b/driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java @@ -318,7 +318,7 @@ static RegexSearchOperator regex(final Iterable paths, fin Iterator queryIterator = notNull("queries", queries).iterator(); isTrueArgument("queries must not be empty", queryIterator.hasNext()); String firstQuery = queryIterator.next(); - return new SearchConstructibleBsonElement("phrase", new Document("path", combineToBsonValue(pathIterator, false)) + return new SearchConstructibleBsonElement("regex", new Document("path", combineToBsonValue(pathIterator, false)) .append("query", queryIterator.hasNext() ? queries : firstQuery)); } diff --git a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java index f4fbd3498f0..0c53ad4b97e 100644 --- a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java +++ b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java @@ -594,7 +594,7 @@ void regex() { SearchOperator.regex(emptyList(), singleton("term")) ), () -> assertEquals( - new BsonDocument("phrase", + new BsonDocument("regex", new BsonDocument("path", fieldPath("fieldName").toBsonValue()) .append("query", new BsonString("term")) ), @@ -604,7 +604,7 @@ void regex() { .toBsonDocument() ), () -> assertEquals( - new BsonDocument("phrase", + new BsonDocument("regex", new BsonDocument("path", new BsonArray(asList( fieldPath("fieldName").toBsonValue(), wildcardPath("wildc*rd").toBsonValue()))) @@ -622,7 +622,7 @@ void regex() { .toBsonDocument() ), () -> assertEquals( - new BsonDocument("phrase", + new BsonDocument("regex", new BsonDocument("path", fieldPath("fieldName").toBsonValue()) .append("query", new BsonString("term")) .append("allowAnalyzedField", new BsonBoolean(true)) @@ -634,7 +634,7 @@ void regex() { .toBsonDocument() ), () -> assertEquals( - new BsonDocument("phrase", + new BsonDocument("regex", new BsonDocument("path", fieldPath("fieldName").toBsonValue()) .append("query", new BsonString("term")) .append("allowAnalyzedField", new BsonBoolean(false)) From 8dbcb145845e3cd6f9b9cae1fd60d18dd98e8d9c Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Tue, 14 Jan 2025 15:47:52 -0500 Subject: [PATCH 4/6] remove allowAnalyzedField --- .../model/search/RegexSearchOperator.java | 10 ------ .../SearchConstructibleBsonElement.java | 5 --- .../model/search/SearchOperatorTest.java | 35 ++++++------------- 3 files changed, 10 insertions(+), 40 deletions(-) diff --git a/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java b/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java index 920c2df442a..c0286079714 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java +++ b/driver-core/src/main/com/mongodb/client/model/search/RegexSearchOperator.java @@ -30,14 +30,4 @@ public interface RegexSearchOperator extends SearchOperator { @Override RegexSearchOperator score(SearchScore modifier); - - /** - * Creates a new {@link RegexSearchOperator} that uses allowAnalyzedField. - * - * @param allowAnalyzedField Must be set to true if the query is run against an analyzed field. - * @return A new {@link RegexSearchOperator}. - * - * @mongodb.atlas.manual atlas-search/allowAnalyzedField/ allowAnalyzedField mappings - */ - RegexSearchOperator allowAnalyzedField(boolean allowAnalyzedField); } diff --git a/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java b/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java index b6255f95a1b..ee168689df3 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java +++ b/driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java @@ -88,11 +88,6 @@ public TextSearchOperator synonyms(final String name) { }); } - @Override - public RegexSearchOperator allowAnalyzedField(final boolean allowAnalyzedField) { - return newWithAppendedValue("allowAnalyzedField", allowAnalyzedField); - } - @Override public AutocompleteSearchOperator anyTokenOrder() { return newWithAppendedValue("tokenOrder", "any"); diff --git a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java index eda31724ee0..e914f098f70 100644 --- a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java +++ b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java @@ -19,7 +19,6 @@ import com.mongodb.client.model.geojson.Point; import com.mongodb.client.model.geojson.Position; import org.bson.BsonArray; -import org.bson.BsonBoolean; import org.bson.BsonDateTime; import org.bson.BsonDocument; import org.bson.BsonDouble; @@ -671,6 +670,16 @@ void regex() { "term") .toBsonDocument() ), + () -> assertEquals( + new BsonDocument("regex", + new BsonDocument("path", fieldPath("fieldName").toBsonValue()) + .append("query", new BsonString("term")) + ), + SearchOperator.regex( + singleton(fieldPath("fieldName")), + singleton("term")) + .toBsonDocument() + ), () -> assertEquals( new BsonDocument("regex", new BsonDocument("path", new BsonArray(asList( @@ -688,30 +697,6 @@ void regex() { "term1", "term2")) .toBsonDocument() - ), - () -> assertEquals( - new BsonDocument("regex", - new BsonDocument("path", fieldPath("fieldName").toBsonValue()) - .append("query", new BsonString("term")) - .append("allowAnalyzedField", new BsonBoolean(true)) - ), - SearchOperator.regex( - singleton(fieldPath("fieldName")), - singleton("term")) - .allowAnalyzedField(true) - .toBsonDocument() - ), - () -> assertEquals( - new BsonDocument("regex", - new BsonDocument("path", fieldPath("fieldName").toBsonValue()) - .append("query", new BsonString("term")) - .append("allowAnalyzedField", new BsonBoolean(false)) - ), - SearchOperator.regex( - singleton(fieldPath("fieldName")), - singleton("term")) - .allowAnalyzedField(false) - .toBsonDocument() ) ); } From 71de63fc4c30956b5a0f6c2ca3e17f645ee5e03d Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Wed, 15 Jan 2025 14:09:02 -0500 Subject: [PATCH 5/6] fix spacing --- .../client/model/search/SearchOperatorTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java index e914f098f70..02dc8d3fa04 100644 --- a/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java +++ b/driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java @@ -598,8 +598,8 @@ void phrase() { .append("query", new BsonString("term")) ), SearchOperator.phrase( - fieldPath("fieldName"), - "term") + fieldPath("fieldName"), + "term") .toBsonDocument() ), () -> assertEquals( @@ -627,8 +627,8 @@ void phrase() { .append("synonyms", new BsonString("synonymMappingName")) ), SearchOperator.phrase( - singleton(fieldPath("fieldName")), - singleton("term")) + singleton(fieldPath("fieldName")), + singleton("term")) .synonyms("synonymMappingName") .toBsonDocument() ), @@ -640,8 +640,8 @@ void phrase() { .append("slop", new BsonInt32(5)) ), SearchOperator.phrase( - singleton(fieldPath("fieldName")), - singleton("term")) + singleton(fieldPath("fieldName")), + singleton("term")) .synonyms("synonymMappingName") .slop(5) .toBsonDocument() From ee5ae13105d73a5a4cd61174a0228b39d3f02a63 Mon Sep 17 00:00:00 2001 From: Joy Kim Date: Wed, 15 Jan 2025 15:36:21 -0500 Subject: [PATCH 6/6] fix checkstyle --- driver-kotlin-extensions/build.gradle.kts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver-kotlin-extensions/build.gradle.kts b/driver-kotlin-extensions/build.gradle.kts index e0192fa5abc..76f36ca33b2 100644 --- a/driver-kotlin-extensions/build.gradle.kts +++ b/driver-kotlin-extensions/build.gradle.kts @@ -165,4 +165,6 @@ tasks.javadocJar.configure { // =========================== tasks.sourcesJar { from(project.sourceSets.main.map { it.kotlin }) } -afterEvaluate { tasks.jar { manifest { attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.extensions" } } } +afterEvaluate { + tasks.jar { manifest { attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.extensions" } } +}