-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension: select distinct #96
Comments
This seems like a valid use case to me. NB |
I think just adding the keyword as if it is a property would be fine:
There is no field called We could require the This would return pseudo entities, since there are likely to be multiple entities that match each returned combination. As a result it can not be combined with $expand, but could be combined with all other query parameters ($top, $skip, $count, $filter) and could be used inside an expand:
|
The detailed syntax can be up to discussion. Personally, I feel like using a different syntax/seperator than |
I've done a prototype implementation in FROST, for people that would like to play around with this: https://lubw.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Things?$select=distinct:properties/type |
It is quite useful to give Entities common properties, like a "type". But when filtering on such a common property the client needs to know what the used values are. As it is, to find all the possible values for a field, the user either has to download all entities to find all values, or use a series of request, progressively excluding the values it already knows of.
It would be nice if we could do something like adding a
distinct
keyword to the$select
request parameter, similar to what can be done in SQL.This would also require allowing
$select
to work on sub-properties. So$select=properties/type
would not return the full properties object, but only the selected parts.The text was updated successfully, but these errors were encountered: