Start a new topic

HTML5 query with only specific fields in response


The RestAPI allows passing in the fields that should be returned in the response. Havent been able to figure out how to do the same with HTML5 SDK. Can you please let me know if its possible and if yes point me to the documentation or provide an example.

We don't *think* this is possible with the HTML5 library method, however why exactly can't you just strip out the unnecessary fields when you receive the response? Otherwise you can always use business logic to implement a post fetch collection hook.
Well, the collection has about 100 fields and all I am interested is in 3 fields for this particular query. The query will return about 700 entities so the difference is between returning 70000 fields (and stripping on client side) vs 2100 fields. And if the same query has to be done across 10 collections, you can imagine why stripping on client side is not an option. Using business logic is also not an option because of the hard timeout limit of 2 seconds that gets hit fairly often as the dataset size increases.
This is not supported right now. Workaround could be to use a custom endpoint and use [`modules.collectionAccess`]( directly. This way, you should stay under the 2 second time limit.
Login or Signup to post a comment