The Filters.geoIntersects returns nothing from Java App while querying for the same data from Robo 3T returns some

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Builders
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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
      // Using script in Robo 3T ==> returns a few records

      db.getCollection('locations').find( {
      place: {
      $geoIntersects: {
      $geometry:

      { type: "Point" , coordinates: [131.005440, 33.784371 ] }

      }
      }
      }
      )

      // 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());       }

          });

      ```

            Assignee:
            Jeffrey Yemin
            Reporter:
            John Dang
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: