You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Find the distinct values for a specified column #2238
@ranhsd, I just poked around out of curiosity, I'd think that you'd need to add it first to RestQuery which will call find on the DataBaseController that will then use the MongoCollection.find (or postgress). Would at least need to touch a comment in LiveQuery/QueryTools.js
This is just my quick look around. Seems like following how skip and limit are done are good parallels since they are constraints on a find, like distinct is.
I think the API suggested in the beginning of the thread would be good:
curl -X GET
-H "X-Parse-Application-Id: REDACTED"
-H "X-Parse-REST-API-Key: REDACTED"
-G
--data-urlencode 'distinct=score' https://api.parse.com/1/classes/GameScore
We would have to handle this in ClassesRouter -> rest -> RestQuery -> DataBaseController -> Mongo and Postrgres adapters.
I don’t think so. But it does support dot notation. Feel free to open a PR, we’ll review it. You could do distinct(PointerField.objectId) but that’s just a workaround
Activity
flovilmart commentedon Jul 8, 2016
This is not implemented yet but you could work on a PR that implements it
codebreach commentedon Jul 16, 2016
I can take this up. Is there a API design for this?
looking at how REST queries work I would assume it to look something like:
flovilmart commentedon Jul 16, 2016
We usually Mark custom operators with a $ i.e. $distinct
ranhsd commentedon Sep 18, 2016
Any news regarding this enhancement ?
thanks.
flovilmart commentedon Sep 18, 2016
@ranhsd It's up for the taking :)
ranhsd commentedon Sep 21, 2016
@flovilmart This change should be done in the DataBaseController.js right ?
acinader commentedon Sep 21, 2016
@ranhsd, I just poked around out of curiosity, I'd think that you'd need to add it first to RestQuery which will call find on the DataBaseController that will then use the MongoCollection.find (or postgress). Would at least need to touch a comment in LiveQuery/QueryTools.js
This is just my quick look around. Seems like following how skip and limit are done are good parallels since they are constraints on a find, like distinct is.
ymmv :)
otmezger commentedon Sep 30, 2016
+1 for this feature
oallouch commentedon Oct 3, 2016
I know MongoDB well and what would be great for me is a way to use mongo directly, with the aggregation framework and all. I know it's a lot a ask.
joshgare commentedon Nov 3, 2016
+1
pewh commentedon Mar 5, 2017
+1 Any news on this implementation?
natanrolnik commentedon Mar 5, 2017
@pewh no, but PRs are more than welcome 😉
Cliffordwh commentedon Mar 6, 2017
Im sure there was a PR already for this! can anybody confirm?
ridergeek commentedon Mar 14, 2017
+1 for this. @Cliffordwh - I did a quick search on open/closed PRs and couldn't find this. Hoping someone will pick this up and implement soon.
shi1hh commentedon May 28, 2017
china parse
Key Operation
link http://docs.bmob.cn/data/Restful/b_developdoc/doc/index.html
wy1024 commentedon Jun 26, 2017
After hours of looking, the only solution i found is to get all rows and do distinct by yourself.
To get all rows, beyond the limit of 1000, and the skip limit of 10000, this is a great solution.
http://cyber-duck.github.io/2016/03/18/how-to-retrieve-all-objects-on-parse-without-api-limitation/
natanrolnik commentedon Jun 27, 2017
@davimacedo We could have some query parameters to select distinct values, no? What do you think?
davimacedo commentedon Jun 28, 2017
I think the API suggested in the beginning of the thread would be good:
curl -X GET
-H "X-Parse-Application-Id: REDACTED"
-H "X-Parse-REST-API-Key: REDACTED"
-G
--data-urlencode 'distinct=score'
https://api.parse.com/1/classes/GameScore
We would have to handle this in ClassesRouter -> rest -> RestQuery -> DataBaseController -> Mongo and Postrgres adapters.
For mongo we can implement it using https://docs.mongodb.com/manual/reference/method/db.collection.distinct/.
For postgres using SELECT DISTINCT ... (https://www.postgresql.org/docs/9.0/static/sql-select.html)
I've just added it to my personal kanban. I can try to write something soon.
BRC-solutions commentedon Aug 27, 2017
We really need this
dplewis commentedon Nov 12, 2017
Closes #2238 Via #4207
fmendoza commentedon Dec 21, 2017
Does the new aggregate queries support pointers?
dplewis commentedon Dec 22, 2017
I don’t think so. But it does support dot notation. Feel free to open a PR, we’ll review it. You could do
distinct(PointerField.objectId)but that’s just a workaroundfmendoza commentedon Dec 22, 2017
yeah I tried your suggestion before (pointer.objectId) before but no results
dplewis commentedon Dec 22, 2017
It’s up for the taking 😉