-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add in operator to Atlas Search #1605
Conversation
|
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
* @return The requested {@link SearchOperator}. | ||
* @mongodb.atlas.manual atlas-search/in/ in operator | ||
*/ | ||
static InSearchOperator in(final FieldSearchPath path, final ObjectId value, final ObjectId... values) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is based on
static DateRangeSearchOperatorBase dateRange(final FieldSearchPath path, final FieldSearchPath... paths)
Having two params ensures that the user is unable to provide zero values. I am not sure we should do this even there, but I think in this case, we should not have both of these params, but just the values, since the docs did not seem to exclude empty lists. (Note that the docs on values seem to be incorrect)
@stIncMale cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check if the server actually allows passing value: []
.
- If it does not, then following the approach taken in the rest of the search building API, we should introduce
in(final FieldSearchPath path, final ObjectId value, final ObjectId... values)
. We may follow that with adding another thing to be re-reviewed to JAVA-5752: Re-visit some aspects of the Atlas search API design before moving it out of beta - If the server indeed allows passing
value: []
, then we should rather introducein(final FieldSearchPath path, final ObjectId... values)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not allow. See https://search-playground.mongodb.com/tools/code-sandbox/snapshots/6793c3ebe68ae0bae860e843
Added comment to 5752
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last reviewed commit is 65840eb. I did not fully review all commits before it.
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java
Outdated
Show resolved
Hide resolved
…rator.java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
# Conflicts: # driver-core/src/main/com/mongodb/client/model/search/SearchConstructibleBsonElement.java # driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java # driver-core/src/test/functional/com/mongodb/client/model/search/AggregatesSearchIntegrationTest.java # driver-core/src/test/unit/com/mongodb/client/model/search/SearchOperatorTest.java # driver-scala/src/main/scala/org/mongodb/scala/model/search/SearchOperator.scala # driver-scala/src/main/scala/org/mongodb/scala/model/search/package.scala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last reviewed commit is d0dfa2b.
driver-core/src/main/com/mongodb/client/model/search/SearchOperator.java
Outdated
Show resolved
Hide resolved
…rator.java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
Ticket
JAVA-5744
Description
There are several Atlas Search query operators that are not implemented with first class support in the Java driver. This PR adds the
in
operator to Atlas Search.Testing
./gradlew check
atlas-search-test
on EvergreenSearchOperatorTest