Closed knitzsche closed 10 years ago
'mode' is already returned in every result object. Running the metros example from the README with master:
[{"dis":0.000011879338863382652,"obj":{"name":"Encants de Sant Adrià","loc":{"type":"Point","coordinates":[2.22290444983689,41.4304584678793]},"mode":"metro","city":"Barcelona","_id":"53b89d5df3ff750b732120c1"}}]
But feel free to submit a PR to update the docs to match the actual code.
Thanks.
Currently, the server only returns a mode object when the query is of type all.
Please consider always returning the mode in each result object. This would simplify parsing by allowing the same code path on every result based on the confidence that every result states its mode.
Also, always returning the mode makes the returned data complete, whereas now its type (mode) is unstated (unless you use all).
Examples from the README.md: curl -i "http://localhost:3000/v1/metros?lat=41.4304&lng=2.222"