NoBrainerORM / nobrainer

Ruby ORM for RethinkDB
http://nobrainer.io/
Other
387 stars 49 forks source link

First class support for distinct? #174

Open ajselvig opened 9 years ago

ajselvig commented 9 years ago

This is easy enough to do in ReQL, just wondering if it's worth offering NoBrainer syntax for it:

NoBrainer.run { |r| r.table("model").distinct({"index" => "foo"})

Maybe something like:

Model.distinct(index: :foo)
nviennot commented 9 years ago

hum.. dinstinct kinda break down the notion of objects mapped to documents. I'm not sure I can do an API that makes sense. distinct() kinda makes sense only when used with .raw() right?

ajselvig commented 9 years ago

Yeah, there wouldn't be any mapping, just returning a raw value (array). So more like Model.count().

Like I said, it's easy enough right now, so it's not a huge deal.

zedtux commented 3 years ago

Shall we close this issue?