Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The fetch page GET/POST request requires the storage unit name and optionally the scope. Parameters startId (first record by defaultstartId (Optional: mongo record id. If not specified, the first page of data will be returned. Use the last id of the returned page as the startId for the next page request), batchSizesize (10 by default) and zone (local zone by default) are optional.

Code Block
languagejs
themeRDark
POST access/fetchPage/<storage-unit-name>/<optional:scope>?startId=123456&batchSizesize=20

Response

Fetch page returns a 200 response code and a response body with a records array with batchSize number of records from zone of the storage unit starting at element startId. If more items are available a nextPageStartId field is also part of the response to be used as the startId of a subsequent call for the next page of records.

Code Block
languagejs
themeRDark
{
    "records": [
        {
            "key": "123451APP_ZONE:1234567",
       "version": 3,
     "content": {
      "<scope>": {
         "connectordoc": {
          "test": "value 3"
        ...}
      }
    },
    "_id": "58793d3e7536e718b41fcf62"
  },
  {
    "key": "APP_ZONE:1234568",
     }"version": 3,
        },"content": {
      "<scope>": {
 ...,
       "doc": {
            "keytest": "123458value 2",
        }
     "content": {}
    },
    "_id": "58793d3f7536e718b41fcf65"
  },
  {
    "connectorkey": {"APP_ZONE:1234569",
    "version": 4,
    "content": {
      "<scope>": {
   ...
     "doc": {
          }
  "test": "value 3"
          }
        }
    ]},
    "nextPageStartId_id": "12346558793d3f7536e718b41fcf67"
  }
]

Fetch all records by zone

...

  1. Call fetch page without a startId. This will return the first batchSize records of batch of records of size from the storage unit sorted by key and a reference to the startId for the next page. _id.
  2. Make subsequent calls with the startId last _id of the previous requestarray as the startId
  3. Finish when page response doesn't contain a next page startIdreturns an empty array.

Get File

Downloads a file attached to a file scope of a record key in a storage unit.

...