[JAVA-4691] I have a problem with an aggregation that works in Compass and VScode Extension but not in Java Created: 28/Jul/22 Updated: 27/Oct/23 Resolved: 12/Aug/22 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Aggregation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Joachim Hansen | Assignee: | Ross Lawley |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
SummaryI have a problem with an aggregation that works in Compass and VScode Extension but not in JAVA via spring-boot-starter-data-mongodb. Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).Driver version: 4.6 and 4.7 How to ReproduceI have 3 collections:
Steps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example. Additional BackgroundPlease provide any additional background information that may be helpful in diagnosing the bug. |
| Comments |
| Comment by PM Bot [ 12/Aug/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 28/Jul/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As this sounds like a support issue, I wanted to give you some resources to get this question answered more quickly:
Just in case you have already opened a support case and are not receiving sufficient help, please let me know and I can facilitate escalating your issue. Alternatively, please provide a minimal reproducible example so I can replicate the issue and see if I can determine the cause. All the best, Ross | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Joachim Hansen [ 28/Jul/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Ross, You should be able to put together an example from what I've given you. As I wrote, I've tried to debug the code all the way to the driver, and everything before "fetching" of data seems to be as it should be, but again the resulting data is "missing" in Java, but not in the VScode extension or Compass. Futhermore, the two aggregations are 99% the same, but nr. 2 actually give the same data back on all 3 platforms. So it's only the first aggregation that produces the "error", and it's only 2 values that has been changed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Ross Lawley [ 28/Jul/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
When you say it doesn't work, do you mean it errors? or doesn't return any results? The Java driver doesn't do anything special with the aggregation pipeline - just passes it to the server to perform. The main thing to understand is the actual aggregation pipeline the same and double check there has been no conversion errors? I think to be able to help further we'd need an reproducible example. Ross | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Joachim Hansen [ 28/Jul/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I pressed CTRL+ENTER instead of SHIFT+ENTER, and therefore created the issue before i was done. so here is the rest of the info: hardwareInventory also has a deviceId: ObjectId at the top level
The two aggregations starting from device:
Aggregation number 1 works in Compass and VScode extension but not in JAVA. Number 2 works on all 3 The only difference is in the second $match by the $filter. |