Skip to content

Commit d0b568f

Browse files
authored
Remove Filters.eqFull (#1292)
JAVA-5174
1 parent 0ecac8c commit d0b568f

File tree

6 files changed

+3
-55
lines changed

6 files changed

+3
-55
lines changed

driver-core/src/main/com/mongodb/client/model/Filters.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.mongodb.client.model;
1818

19-
import com.mongodb.annotations.Beta;
2019
import com.mongodb.client.model.geojson.Geometry;
2120
import com.mongodb.client.model.geojson.Point;
2221
import com.mongodb.client.model.search.SearchCollector;
@@ -85,30 +84,11 @@ public static <TItem> Bson eq(@Nullable final TItem value) {
8584
* @param <TItem> the value type
8685
* @return the filter
8786
* @mongodb.driver.manual reference/operator/query/eq $eq
88-
* @see #eqFull(String, Object)
8987
*/
9088
public static <TItem> Bson eq(final String fieldName, @Nullable final TItem value) {
9189
return new SimpleEncodingFilter<>(fieldName, value);
9290
}
9391

94-
/**
95-
* Creates a filter that matches all documents where the value of the field name equals the specified value.
96-
* Unlike {@link #eq(String, Object)}, this method creates a full form of {@code $eq}.
97-
* This method exists temporarily until Atlas starts supporting the short form of {@code $eq}.
98-
* It will likely be removed in the next driver release.
99-
*
100-
* @param fieldName the field name
101-
* @param value the value, which may be null
102-
* @param <TItem> the value type
103-
* @return the filter
104-
* @mongodb.driver.manual reference/operator/query/eq $eq
105-
* @since 4.11
106-
*/
107-
@Beta(Beta.Reason.SERVER)
108-
public static <TItem> Bson eqFull(final String fieldName, @Nullable final TItem value) {
109-
return new OperatorFilter<>("$eq", fieldName, value);
110-
}
111-
11292
/**
11393
* Creates a filter that matches all documents where the value of the field name does not equal the specified value.
11494
*

driver-core/src/main/com/mongodb/client/model/search/VectorSearchOptions.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public interface VectorSearchOptions extends Bson {
3939
* {@link Aggregates#vectorSearch(FieldSearchPath, Iterable, String, long, long, VectorSearchOptions) queryVector}.
4040
* One may use {@link Filters} to create this filter, though not all filters may be supported.
4141
* See the MongoDB documentation for the list of supported filters.
42-
* <p>
43-
* Note that for now one has to use {@link Filters#eqFull(String, Object)} instead of {@link Filters#eq(String, Object)}.</p>
4442
* @return A new {@link VectorSearchOptions}.
4543
*/
4644
VectorSearchOptions filter(Bson filter);

driver-core/src/test/functional/com/mongodb/client/model/search/AggregatesSearchIntegrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import static com.mongodb.client.model.Aggregates.project;
5757
import static com.mongodb.client.model.Aggregates.replaceWith;
5858
import static com.mongodb.client.model.Filters.and;
59-
import static com.mongodb.client.model.Filters.eqFull;
59+
import static com.mongodb.client.model.Filters.eq;
6060
import static com.mongodb.client.model.Filters.gt;
6161
import static com.mongodb.client.model.Filters.gte;
6262
import static com.mongodb.client.model.Filters.in;
@@ -292,14 +292,14 @@ void vectorSearchSupportedFilters() {
292292
assertAll(
293293
() -> asserter.accept(lt("year", 2016)),
294294
() -> asserter.accept(lte("year", 2016)),
295-
() -> asserter.accept(eqFull("year", 2016)),
295+
() -> asserter.accept(eq("year", 2016)),
296296
() -> asserter.accept(gte("year", 2016)),
297297
() -> asserter.accept(gt("year", 2015)),
298298
() -> asserter.accept(ne("year", 2016)),
299299
() -> asserter.accept(in("year", 2000, 2016)),
300300
() -> asserter.accept(nin("year", 2000, 2016)),
301301
() -> asserter.accept(and(gte("year", 2015), lte("year", 2016))),
302-
() -> asserter.accept(or(eqFull("year", 2015), eqFull("year", 2016)))
302+
() -> asserter.accept(or(eq("year", 2015), eq("year", 2016)))
303303
);
304304
}
305305

driver-core/src/test/unit/com/mongodb/client/model/FiltersSpecification.groovy

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import static com.mongodb.client.model.Filters.bitsAnySet
4242
import static com.mongodb.client.model.Filters.elemMatch
4343
import static com.mongodb.client.model.Filters.empty
4444
import static com.mongodb.client.model.Filters.eq
45-
import static com.mongodb.client.model.Filters.eqFull
4645
import static com.mongodb.client.model.Filters.expr
4746
import static com.mongodb.client.model.Filters.geoIntersects
4847
import static com.mongodb.client.model.Filters.geoWithin
@@ -78,12 +77,6 @@ class FiltersSpecification extends Specification {
7877
toBson(eq(1)) == parse('{_id : 1}')
7978
}
8079

81-
def 'should render eqFull'() {
82-
expect:
83-
toBson(eqFull('x', 1)) == parse('{x : {$eq: 1}}')
84-
toBson(eqFull('x', null)) == parse('{x : {$eq: null}}')
85-
}
86-
8780
def 'should render $ne'() {
8881
expect:
8982
toBson(ne('x', 1)) == parse('{x : {$ne : 1} }')

driver-scala/src/main/scala/org/mongodb/scala/model/Filters.scala

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.mongodb.scala.model
1818

19-
import com.mongodb.annotations.Beta
20-
2119
import java.lang
2220

2321
import scala.collection.JavaConverters._
@@ -51,22 +49,6 @@ object Filters {
5149
*/
5250
def eq[TItem](fieldName: String, value: TItem): Bson = JFilters.eq(fieldName, value)
5351

54-
/**
55-
* Creates a filter that matches all documents where the value of the field name equals the specified value.
56-
* Unlike `Filters.eq`, this method creates a full form of `\$eq`.
57-
* This method exists temporarily until Atlas starts supporting the short form of `\$eq`.
58-
* It will likely be removed in the next driver release.
59-
*
60-
* @param fieldName the field name
61-
* @param value the value
62-
* @tparam TItem the value type
63-
* @return the filter
64-
* @see [[https://www.mongodb.com/docs/manual/reference/operator/query/eq \$eq]]
65-
* @since 4.11
66-
*/
67-
@Beta(Array(Beta.Reason.SERVER))
68-
def eqFull[TItem](fieldName: String, value: TItem): Bson = JFilters.eqFull(fieldName, value)
69-
7052
/**
7153
* Allows the use of aggregation expressions within the query language.
7254
*

driver-scala/src/test/scala/org/mongodb/scala/model/FiltersSpec.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ class FiltersSpec extends BaseSpec {
5353
toBson(model.Filters.equal("x", null)) should equal(Document("""{x : null}"""))
5454
}
5555

56-
it should "render eqFull" in {
57-
toBson(model.Filters.eqFull("x", 1)) should equal(Document("""{x : {$eq: 1}}"""))
58-
toBson(model.Filters.eqFull("x", null)) should equal(Document("""{x : {$eq: null}}"""))
59-
}
60-
6156
it should "render $ne" in {
6257
toBson(model.Filters.ne("x", 1)) should equal(Document("""{x : {$ne : 1} }"""))
6358
toBson(model.Filters.ne("x", null)) should equal(Document("""{x : {$ne : null} }"""))

0 commit comments

Comments
 (0)