diff --git a/driver-core/src/main/com/mongodb/client/model/Filters.java b/driver-core/src/main/com/mongodb/client/model/Filters.java index b247a62595b..c516fe28930 100644 --- a/driver-core/src/main/com/mongodb/client/model/Filters.java +++ b/driver-core/src/main/com/mongodb/client/model/Filters.java @@ -16,7 +16,6 @@ package com.mongodb.client.model; -import com.mongodb.annotations.Beta; import com.mongodb.client.model.geojson.Geometry; import com.mongodb.client.model.geojson.Point; import com.mongodb.client.model.search.SearchCollector; @@ -85,30 +84,11 @@ public static Bson eq(@Nullable final TItem value) { * @param the value type * @return the filter * @mongodb.driver.manual reference/operator/query/eq $eq - * @see #eqFull(String, Object) */ public static Bson eq(final String fieldName, @Nullable final TItem value) { return new SimpleEncodingFilter<>(fieldName, value); } - /** - * Creates a filter that matches all documents where the value of the field name equals the specified value. - * Unlike {@link #eq(String, Object)}, this method creates a full form of {@code $eq}. - * This method exists temporarily until Atlas starts supporting the short form of {@code $eq}. - * It will likely be removed in the next driver release. - * - * @param fieldName the field name - * @param value the value, which may be null - * @param the value type - * @return the filter - * @mongodb.driver.manual reference/operator/query/eq $eq - * @since 4.11 - */ - @Beta(Beta.Reason.SERVER) - public static Bson eqFull(final String fieldName, @Nullable final TItem value) { - return new OperatorFilter<>("$eq", fieldName, value); - } - /** * Creates a filter that matches all documents where the value of the field name does not equal the specified value. * diff --git a/driver-core/src/main/com/mongodb/client/model/search/VectorSearchOptions.java b/driver-core/src/main/com/mongodb/client/model/search/VectorSearchOptions.java index a17a41e8748..e512ab0a31c 100644 --- a/driver-core/src/main/com/mongodb/client/model/search/VectorSearchOptions.java +++ b/driver-core/src/main/com/mongodb/client/model/search/VectorSearchOptions.java @@ -39,8 +39,6 @@ public interface VectorSearchOptions extends Bson { * {@link Aggregates#vectorSearch(FieldSearchPath, Iterable, String, long, long, VectorSearchOptions) queryVector}. * One may use {@link Filters} to create this filter, though not all filters may be supported. * See the MongoDB documentation for the list of supported filters. - *

- * Note that for now one has to use {@link Filters#eqFull(String, Object)} instead of {@link Filters#eq(String, Object)}.

* @return A new {@link VectorSearchOptions}. */ VectorSearchOptions filter(Bson filter); 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 18ab9259393..b67cf37af93 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 @@ -56,7 +56,7 @@ import static com.mongodb.client.model.Aggregates.project; import static com.mongodb.client.model.Aggregates.replaceWith; import static com.mongodb.client.model.Filters.and; -import static com.mongodb.client.model.Filters.eqFull; +import static com.mongodb.client.model.Filters.eq; import static com.mongodb.client.model.Filters.gt; import static com.mongodb.client.model.Filters.gte; import static com.mongodb.client.model.Filters.in; @@ -292,14 +292,14 @@ void vectorSearchSupportedFilters() { assertAll( () -> asserter.accept(lt("year", 2016)), () -> asserter.accept(lte("year", 2016)), - () -> asserter.accept(eqFull("year", 2016)), + () -> asserter.accept(eq("year", 2016)), () -> asserter.accept(gte("year", 2016)), () -> asserter.accept(gt("year", 2015)), () -> asserter.accept(ne("year", 2016)), () -> asserter.accept(in("year", 2000, 2016)), () -> asserter.accept(nin("year", 2000, 2016)), () -> asserter.accept(and(gte("year", 2015), lte("year", 2016))), - () -> asserter.accept(or(eqFull("year", 2015), eqFull("year", 2016))) + () -> asserter.accept(or(eq("year", 2015), eq("year", 2016))) ); } diff --git a/driver-core/src/test/unit/com/mongodb/client/model/FiltersSpecification.groovy b/driver-core/src/test/unit/com/mongodb/client/model/FiltersSpecification.groovy index 478752a8584..9c9a4bc8748 100644 --- a/driver-core/src/test/unit/com/mongodb/client/model/FiltersSpecification.groovy +++ b/driver-core/src/test/unit/com/mongodb/client/model/FiltersSpecification.groovy @@ -42,7 +42,6 @@ import static com.mongodb.client.model.Filters.bitsAnySet import static com.mongodb.client.model.Filters.elemMatch import static com.mongodb.client.model.Filters.empty import static com.mongodb.client.model.Filters.eq -import static com.mongodb.client.model.Filters.eqFull import static com.mongodb.client.model.Filters.expr import static com.mongodb.client.model.Filters.geoIntersects import static com.mongodb.client.model.Filters.geoWithin @@ -78,12 +77,6 @@ class FiltersSpecification extends Specification { toBson(eq(1)) == parse('{_id : 1}') } - def 'should render eqFull'() { - expect: - toBson(eqFull('x', 1)) == parse('{x : {$eq: 1}}') - toBson(eqFull('x', null)) == parse('{x : {$eq: null}}') - } - def 'should render $ne'() { expect: toBson(ne('x', 1)) == parse('{x : {$ne : 1} }') diff --git a/driver-scala/src/main/scala/org/mongodb/scala/model/Filters.scala b/driver-scala/src/main/scala/org/mongodb/scala/model/Filters.scala index a02d0110ca2..cff938d6842 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/model/Filters.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/model/Filters.scala @@ -16,8 +16,6 @@ package org.mongodb.scala.model -import com.mongodb.annotations.Beta - import java.lang import scala.collection.JavaConverters._ @@ -51,22 +49,6 @@ object Filters { */ def eq[TItem](fieldName: String, value: TItem): Bson = JFilters.eq(fieldName, value) - /** - * Creates a filter that matches all documents where the value of the field name equals the specified value. - * Unlike `Filters.eq`, this method creates a full form of `\$eq`. - * This method exists temporarily until Atlas starts supporting the short form of `\$eq`. - * It will likely be removed in the next driver release. - * - * @param fieldName the field name - * @param value the value - * @tparam TItem the value type - * @return the filter - * @see [[https://www.mongodb.com/docs/manual/reference/operator/query/eq \$eq]] - * @since 4.11 - */ - @Beta(Array(Beta.Reason.SERVER)) - def eqFull[TItem](fieldName: String, value: TItem): Bson = JFilters.eqFull(fieldName, value) - /** * Allows the use of aggregation expressions within the query language. * diff --git a/driver-scala/src/test/scala/org/mongodb/scala/model/FiltersSpec.scala b/driver-scala/src/test/scala/org/mongodb/scala/model/FiltersSpec.scala index 26e1ec0d127..52a7b4254c1 100644 --- a/driver-scala/src/test/scala/org/mongodb/scala/model/FiltersSpec.scala +++ b/driver-scala/src/test/scala/org/mongodb/scala/model/FiltersSpec.scala @@ -53,11 +53,6 @@ class FiltersSpec extends BaseSpec { toBson(model.Filters.equal("x", null)) should equal(Document("""{x : null}""")) } - it should "render eqFull" in { - toBson(model.Filters.eqFull("x", 1)) should equal(Document("""{x : {$eq: 1}}""")) - toBson(model.Filters.eqFull("x", null)) should equal(Document("""{x : {$eq: null}}""")) - } - it should "render $ne" in { toBson(model.Filters.ne("x", 1)) should equal(Document("""{x : {$ne : 1} }""")) toBson(model.Filters.ne("x", null)) should equal(Document("""{x : {$ne : null} }"""))