[JAVA-2080] The $near query works from the shell but complains that it can't find index from morphia Created: 08/Jan/16  Updated: 11/Sep/19  Resolved: 11/Jan/16

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 3.2.0
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: riju pahwa Assignee: Unassigned
Resolution: Done Votes: 0
Labels: morphia
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

eclipse, mongodb on rhel, morphia 1.0.1



 Description   

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'



 Comments   
Comment by Jeffrey Yemin [ 08/Jan/16 ]

This project is for reporting issues with the MongoDB Java driver.

Please see the this page for how to report issues and get help with Morphia.

Regards,
Jeff

Generated at Thu Feb 08 08:56:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.