Open neumino opened 9 years ago
@neumino are you talking about the bracket ReQL term? Doesn't this already work on Query
?
@marshall007 -- Model.filter({foo: 'bar})("field")
doesn't work.
An instance of Query is an object, not a function.
However, this works fine Model.filter({foo: 'bar}).getField("field")
, Model.filter({foo: 'bar}).nth(0)
Ah, I mentionned nth
and getField
, but bracket
also works.
Model.filter({foo: 'bar}).bracket("field")
It's just that you can't do
Model.filter({foo: 'bar})("field")
You're right. I was thinking of inner queries using r.row()
.
BTW, not sure where to doc this, but nth(0) throws a weird error when there's no results... I switched to .get(0) in promises so that I can just check if it's blank or not.
This is expected, it's how RethinkDB behaves. You can catch the out of bound error in RethinkDB with default.
It's not possible on Model, but it should be possible for Query.