Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2080

The $near query works from the shell but complains that it can't find index from morphia

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.0
    • Component/s: None
    • Environment:
      eclipse, mongodb on rhel, morphia 1.0.1

      Following is the morphia query:

      final Query<Node> getNodesQuery = datastore.createQuery(Node.class).
      field("point.coordinates").near(-71.097825, 42.386532);//, radius);
      return getNodesQuery.asList();

      Following is the shell query:
      db.nodes.find( { point : { $near : { $geometry :

      { type : "Point" , coordinates : [-71.097825, 42.386532] }

      , $maxDistance : 50 } } } )

      And the error:
      Exception in thread "main" com.mongodb.MongoQueryException: Query failed with error code 17007 and error message 'Unable to execute query: error processing query: ns=nodal_scoring_db_v2.nodes limit=0 skip=0
      Tree: GEONEAR field=point.coordinates maxdist=1.79769e+308 isNearSphere=0
      Sort: {}
      Proj: {}
      planner returned error: unable to find index for $geoNear query'

            Assignee:
            Unassigned Unassigned
            Reporter:
            riju riju pahwa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: