[JAVA-3572] The Filters.geoIntersects returns nothing from Java App while querying for the same data from Robo 3T returns some Created: 27/Dec/19 Updated: 27/Dec/19 Resolved: 27/Dec/19 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Builders |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | John Dang | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I have a Java app using MongoDb ( client version 3.12). I have a Java app using MongoDb ( client version 3.12). The Filters.geoIntersects returns nothing from Java App while querying for the same data from Robo 3T returns some and here is code for both Java and script. What's wrong with my Java code. Am I missing something? ``` javascript db.getCollection('locations').find( { } // Java code returns nothing collection = db.getCollection("locations"); Point curPos = new Point(new Position(131.005440, 33.784371)); collection.find(Filters.geoIntersects("place.coordinates", curPos)) .forEach(new Consumer<Document>() { @Override public void accept(Document t) { logger.info( t.toJson()); }}); ``` |
| Comments |
| Comment by John Dang [ 27/Dec/19 ] | |||||||||||||
|
That's, I thought the coordinates have to be a part of the field. Please close this item. | |||||||||||||
| Comment by Jeffrey Yemin [ 27/Dec/19 ] | |||||||||||||
|
The Java filter generates the following query:
The difference appears to be the field name. Filters.geoIntersects("place", curPos) generates the identical query as Robo 3T. |