I am trying to get a valid result from the following DocumentDB spatial query.
In both LINQ or SQL -
SELECT * FROM root
WHERE (ST_Distance(root["Address"]["Location"]["Queryable"],
{"type": "Point", "coordinates": [-36.******, 174.******]}) < 10000)
...and/or:
FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1, EnableScanInQuery = true };
IQueryable<Store> documentQuery = client.CreateDocumentQuery<Store>(
UriFactory.CreateDocumentCollectionUri(this.databaseName, this.collection), queryOptions)
.Where(s => s.Address.Location.Queryable.Distance(store.Address.Location.Queryable) < 10000);
...both approaches give me the same result - empty set.
But there are two "Store" documents in the database that should be resolved by this query.
My DB instance is in Australia East - that should be fine apparently.
What am I doing wrong here? My Collection does not have a spatial index on it - is it required?
root["Address"]["Location"]["Queryable"]look like? - Larry Maccherone