FerretDB icon indicating copy to clipboard operation
FerretDB copied to clipboard

Implement `distinct` command

Open AlekSi opened this issue 1 year ago • 2 comments

https://www.mongodb.com/docs/manual/reference/command/distinct/

AlekSi avatar Jul 26 '22 15:07 AlekSi

I'd be interested in implementing this if possible, are there any examples of other commands implemented?

abheekda1 avatar Jul 26 '22 21:07 abheekda1

https://github.com/FerretDB/FerretDB/blob/main/internal/handlers/pg/msg_count.go is probably the most similar

AlekSi avatar Jul 27 '22 04:07 AlekSi

So, are both Postgres and Tigris in scope as usual?

rumyantseva avatar Dec 08 '22 09:12 rumyantseva

Potentially tricky part: nested objects

rumyantseva avatar Dec 08 '22 09:12 rumyantseva

I guess collation is not in the scope too.

rumyantseva avatar Dec 08 '22 09:12 rumyantseva

One more question: how should results be sorted if we in the given field we have data of different types

rumyantseva avatar Dec 08 '22 09:12 rumyantseva

@AlekSi please answer the questions above ^

rumyantseva avatar Dec 14 '22 14:12 rumyantseva

So, are both Postgres and Tigris in scope as usual?

Yes, as usual

I guess collation is not in the scope too

It would be weird to start supporting collations (#10) in this issue

One more question: how should results be sorted if we in the given field we have data of different types

Compatibility tests should pass

AlekSi avatar Dec 14 '22 15:12 AlekSi