0

I want to group filtered result, not all, only filtered. Something like this:

r.table(TABLE_NAME).filter(...).group("supplier").max("ts").run(...)
okuznetsov
  • 278
  • 1
  • 5
  • 12

1 Answers1

1

The query you wrote

r.table("orders").filter({company: "bar"}).group("supplier").max("ts").run(...)

Retrieve all the documents where company is "bar", then group them by supplier, and then for each group, it compute the maximum value for the field "ts". So what you want is what you wrote (except if I misunderstood your question).

yizzlez
  • 8,757
  • 4
  • 29
  • 44
neumino
  • 4,342
  • 1
  • 18
  • 17