Add in operator to Atlas Search#1605
Conversation
|
|
| * @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.
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.
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.
It does not allow. See https://search-playground.mongodb.com/tools/code-sandbox/snapshots/6793c3ebe68ae0bae860e843
Added comment to 5752
…rator.java Co-authored-by: Valentin Kovalenko <[email protected]>
# 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
…rator.java Co-authored-by: Valentin Kovalenko <[email protected]>
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
inoperator to Atlas Search.Testing
./gradlew checkatlas-search-teston EvergreenSearchOperatorTest