ArangoDB内部和附近的查询永远不会返回结果

ArangoDB内部和附近的查询永远不会返回结果,arangodb,Arangodb,我试图在arangodb中运行一些地理查询,但没有得到结果。 这是我试过的 Created index (in java) final Collection<String> fields = new ArrayList<String>(); fields.add("latitude"); fields.add("longitude"); db.collection("foo").ensureGeoIndex(fields,null); 来自web界面的foo记录

我试图在arangodb中运行一些地理查询,但没有得到结果。 这是我试过的

Created index (in java)
 final Collection<String> fields = new ArrayList<String>();
 fields.add("latitude");
 fields.add("longitude");
 db.collection("foo").ensureGeoIndex(fields,null);
来自web界面的foo记录示例

ID  Type    Unique  Sparse  Deduplicate Selectivity Est.    Fields
13362   geo2    false   true    n/a n/a latitude, longitude
{"properties":{"latitude":37.78808138412046,"longitude":-122.080078125}}
FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit) 
    RETURN doc

binding
    @collection foo
    latitude 37.78808138412046
    longitude -122.080078125
    limit 50
从web界面中的“查询”窗口

ID  Type    Unique  Sparse  Deduplicate Selectivity Est.    Fields
13362   geo2    false   true    n/a n/a latitude, longitude
{"properties":{"latitude":37.78808138412046,"longitude":-122.080078125}}
FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit) 
    RETURN doc

binding
    @collection foo
    latitude 37.78808138412046
    longitude -122.080078125
    limit 50
始终返回一个空数组,即使我有很多记录的确切位置

Info: 
using storage engine mmfiles
ArangoDB 3.2.8 [darwin] 64bit, using jemalloc, VPack 0.1.30, RocksDB 5.6.0, ICU 58.1, V8 5.7.492.77, OpenSSL 1.0.2k 26 Jan 2017

只是为了完成问题,不要将位置字段放在对象的嵌套属性中-这是我的问题

只是为了完成问题,不要将位置字段放在对象的嵌套属性中-这是我的问题

我解决了。我将位置值嵌套在properties对象中,而不是将其作为顶级字段进行显示。我将位置值嵌套在properties对象中,而不是将其作为顶级字段