Skip to content

1.1.4 Projection

Anders Mikkelsen edited this page Dec 14, 2017 · 3 revisions

Projection

  • Projection can and should be performed wherever possible to ensure you only receive the specific data you need.
  • You can still do filtering and ordering as usual regardless of projected fields, you can f.ex. do filtering on an attribute, without projecting it.
  • Projection is defined by an url encoded json.
  • Projection can be performed on all operations, except AVG, SUM and COUNT aggregations, they are automatically projected for performance.
  • You can project on any attribute. Key Values will always be projected, regardless of projection-selection on Index routes, they must be projected to generate pageTokens regardless.
  • Available projection options are:
    • fields (String array of fields to project)
{
  "fields":["someField","someOtherField","someThirdField"]
} 
Examples
{
  "fields":["feedId"]
}

{
  "fields":["providerFeedItemId","likeCount","feedId"]
} 
Above examples as Url Encoded Json.

projection=%7B%22fields%22%3A%5B%22feedId%22%5D%7D

projection=%7B%22fields%22%3A%5B%22providerFeedItemId%22%2C%22likeCount%22%2C%22feedId%22%5D%7D