nobrainer icon indicating copy to clipboard operation
nobrainer copied to clipboard

First class support for distinct?

Open ajselvig opened this issue 10 years ago • 3 comments

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)

ajselvig avatar Oct 28 '15 20:10 ajselvig

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?

nviennot avatar Nov 07 '15 23:11 nviennot

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.

ajselvig avatar Nov 07 '15 23:11 ajselvig

Shall we close this issue?

zedtux avatar Feb 06 '21 08:02 zedtux