[JAVA-4583] Stop using null values in the Scala query building API for $setWindowFields Created: 20/Apr/22 Updated: 17/May/22 Resolved: 17/May/22 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Builders |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Valentin Kavalenka | Assignee: | Valentin Kavalenka |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Minor Change | ||||||||
| Documentation Changes: | Needed | ||||||||
| Documentation Changes Summary: | We need to update examples in https://mongodb.github.io/mongo-java-driver/4.6/driver-scala/builders/aggregation/#setwindowfields such that they wrap references in `Some` where needed: val pastMonth: Window = Windows.timeRange(-1, MongoTimeUnit.MONTH, Windows.Bound.CURRENT) P.S. Note also that the order of arguments passed to the `timeRange` differs from that in the currently published example. This is because the order in the currently published example is incorrect. |
||||||||
| Description |
|
While this API is still marked as @Beta, we have a chance to change the docs and maybe the wrappers such that the API can be used without passing null values, as using them is discouraged in Scala 2 (and here is something about null s in Scala 3). The API was added in this commit, and uses null in the following program elements:
Also, the test "render $setWindowFields with no partitionBy/sortBy" passes null s when uses the API. We should start accepting scala.Option for null-able parameters. |
| Comments |
| Comment by Githook User [ 17/May/22 ] |
|
Author: {'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}Message: Stop using `null` values in the Scala query building API for `$setWindowFields` (#937)
|