AtnNn / librethinkdbxx

RethinkDB driver for C++
Other
98 stars 31 forks source link

Adding a Geo Reference #32

Closed CCJH closed 7 years ago

CCJH commented 7 years ago

Is there anyway to add a point to an object without calling run i.e.

RethinkDB::Object({{"TS", RethinkDB::Time(newdata->fix.time)},{"POS", RethinkDB::point(newdata->fix.latitude, newdata->fix.longitude))}})

Instead of

RethinkDB::Object({{"TS", RethinkDB::Time(newdata->fix.time)},{"POS", RethinkDB::point(newdata->fix.latitude, newdata->fix.longitude).run(*Conn())}})

mbroadst commented 7 years ago

@CCJH geo types are not presently (fully) implemented, but contributions are very much welcome.

AtnNn commented 7 years ago

You can use the internal representation of geometry objects. If it were implemented, this is what R::Point would map to:

{
  '$reql_type$': 'GEOMETRY',
  'type': 'Point',
  'coordinates': [0, 0]
}
CCJH commented 7 years ago

That works great, thanks.