thinky
thinky copied to clipboard
Points -> Arrays in toJSON()?
Currently when calling model.toJSON() you get this:
"endLocation": {
"$reql_type$": "GEOMETRY",
"coordinates": [
40.719212,
-73.958426
],
"type": "Point"
}
It seems appropriate to instead do this:
"endLocation": [
40.719212,
-73.958426
]
Thoughts?
Hum, I'm worried people will try to do stuff like filter(r.row("endLocation").nth(0) < 10)
RethinkDB maps a few reql objects to native ones: groups, dates, but not location.
If we were to provide a better interface for locations, I would rather wrap things in an object created by a library that let's me do more things with locations - not just an array.
@neumino Talking strictly about having an instance of a model and calling toJSON() on it, nothing to do with querying.
new Model({
location: r.point(lon, lat)
}).toJSON()