You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RqlRuntimeError: Secondary keys must be a number, string, bool, or array (got {
"crispy": true,
"salty": true
} of type OBJECT) in:
r.db("test").table("hams").getAll({crispy: true, salty: true}, {index: "bacon"})
I ran into this limitation and @mlucy mentioned there was no technical reason objects aren't supported in secondary indexes.
Note to whoever will take this issue:
We also decided to treat geometry (PTYPE<GEOMETRY>) like objects in (non-geo) secondary indexes.
In daniel_geo trying to use a geometry object as a secondary index key currently fails in datum_t::pt_to_str_key(). Once we have support for converting objects to secondary index keys, we should use that same function in that place as well (though with a different prefix to maintain between-types ordering).
Feel free to assign the transfer to geometry pseudo types to me once the code for handling objects is there.
You can already compare objects in ReQL with the normal comparator operators. We order the keys lexicographically and compare them key by key (where the absence of a key is considered to be smaller than any value for that key).
Activity
neumino commentedon Jul 29, 2014
Related to #1032
danielmewes commentedon Jul 30, 2014
Note to whoever will take this issue:
We also decided to treat geometry (
PTYPE<GEOMETRY>) like objects in (non-geo) secondary indexes.In
daniel_geotrying to use a geometry object as a secondary index key currently fails indatum_t::pt_to_str_key(). Once we have support for converting objects to secondary index keys, we should use that same function in that place as well (though with a different prefix to maintain between-types ordering).Feel free to assign the transfer to geometry pseudo types to me once the code for handling objects is there.
thelinuxlich commentedon Aug 15, 2014
+1
stuartpb commentedon Apr 24, 2015
Isn't there? How would object values sort for
orderBy?mlucy commentedon Apr 24, 2015
You can already compare objects in ReQL with the normal comparator operators. We order the keys lexicographically and compare them key by key (where the absence of a key is considered to be smaller than any value for that key).