1

Hey I'm using ojCollection to fetch limited records from database, I'm able to create a model and collection with that model. But I'm not clear on how to set the totalSize of fetched record and where to set it. Can some one please share the expected json structure of fetched data in order to get limited records as well as the total size in DB.

Basically I'm not using REST api in my project so it would be helpful if I get the json structure that collection api's are expecting.

Thanks,

4

1 回答 1

1

这是 oracle-jet 遵循的结构。limit 表示分页大小,totalResults 表示 db 中的记录总数,hasMore 表示是否存在记录。

{
    "items": [
      {
        "key1": "value1",
        "key2": "value2"
      }
    ],
    "totalResults": 8,
    "limit": 10,
    "offset": 0,
    "hasMore": "false"
}
于 2017-04-21T06:07:33.810 回答