-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add /$count support for $select #2050
base: main
Are you sure you want to change the base?
Conversation
@@ -2017,7 +2017,8 @@ properties of the identified instances of a structured type, optionally followed | |||
related entity or entities, optionally followed by a [type-cast segment](#AddressingDerivedTypes) | |||
to expand only related entities of that derived type or one of its | |||
sub-types, optionally followed by `/$ref` to expand only entity | |||
references. | |||
references, or `/$count`, optionally with expand options, to return only the count of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
references, or `/$count`, optionally with expand options, to return only the count of | |
references, or `/$count`, optionally with expand options [#OData-Protocol#ExpandOptions], to return only the count of |
http://host/service/Categories?$expand=Products($filter=DiscontinuedDate eq null) | ||
``` | ||
::: | ||
|
||
The `$count` segment can be appended to a navigation property name or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this paragraph a repetition of the third bullet point above?
The [Expand Options](#ExpandOptions) [`$filter`](#SystemQueryOptionfilter), | ||
[`$search`](#SystemQueryOptionsearch), | ||
[`$skip`](#SystemQueryOptionstopandskip), | ||
[`$top`](#SystemQueryOptionstopandskip), and | ||
[`$count`](#SystemQueryOptioncount) can be used to limit the number of | ||
[`$count`](#SystemQueryOptioncount) can be used to include the count of | ||
expanded entity references. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [Expand Options](#ExpandOptions) [`$filter`](#SystemQueryOptionfilter),
[`$search`](#SystemQueryOptionsearch),
[`$skip`](#SystemQueryOptionstopandskip),
[`$top`](#SystemQueryOptionstopandskip) can be used to limit the collection of expanded entity references, and
[`$count`](#SystemQueryOptioncount) can be used to include not the entity references themselves
but their count.
@@ -2207,7 +2211,7 @@ grammar of the `$select` query option. | |||
|
|||
The value of `$select` is a comma-separated list of select items. Each | |||
select item is one of the following: | |||
- a path, to include a property, | |||
- a path, optionally followed by a count segment or select options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- a path, optionally followed by a count segment or select options | |
- a path, optionally followed by a [count segment](#AddressingtheCountofaCollection) or [select options](#SelectOptions) |
select options specified in more than one place in a request and MUST | ||
NOT be specified in more than one expand. | ||
If the path ends in a collection of primitive or complex values, | ||
then the count segment (`/$count`), optionally followed by the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then the count segment (`/$count`), optionally followed by the | |
then the [count segment](#AddressingtheCountofaCollection) (`/$count`), optionally followed by the |
@@ -2370,6 +2373,39 @@ of properties, open properties, navigation properties, actions and | |||
functions to be returned is equal to the union of the set of those | |||
identified by each select item. | |||
|
|||
#### ##subsubsubsec SelectOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### ##subsubsubsec SelectOptions | |
#### ##subsubsubsec Select Options |
Allowed system query options are | ||
[`$compute`](#SystemQueryOptioncompute), | ||
[`$select`](#SystemQueryOptionselect), | ||
`$expand`, and | ||
[`$levels`](#ExpandOptionlevels) for all navigation properties, plus | ||
[`$filter`](#SystemQueryOptionfilter), | ||
[`$orderby`](#SystemQueryOptionorderby), | ||
[`$skip`](#SystemQueryOptionstopandskip), [`$top`](#SystemQueryOptionstopandskip), | ||
[`$count`](#SystemQueryOptioncount), and | ||
[`$search`](#SystemQueryOptionsearch) | ||
for collection-valued navigation properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an explicit list whereas section "Select Options" below refers to section "System Query Options"?
[System Query Options](#SystemQueryOptions), with the exception of | ||
[`$expand`](#SystemQueryOptionexpand). The same property MUST NOT have | ||
select options specified in more than one place in a request and MUST | ||
NOT be specified in more than one expand. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "more than one expand" mean, given that $expand
is ruled out above?
@@ -2224,7 +2228,7 @@ properties defined on the derived type. | |||
A path can end with | |||
- the name of a property or | |||
non-entity-valued instance annotation of the identified | |||
instance of a structured type, | |||
instance of a structured type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance of a structured type | |
instance of a structured type, |
same as in other bullet points
Fixes #2046