Ainoflow Storage icon

Ainoflow Storage

Store and retrieve JSON documents in Ainoflow key-value storage

Record → Get Many

AI-generated

Summary

Retrieve multiple JSON records from a specified category in Ainoflow storage, with support for pagination, sorting, and optional aggregation into a single object.

Inputs

  • category (required) — Category (namespace) for the record (e.g., invoices).
  • returnAll — Whether to return all results or only up to a given limit. Defaults to false.
  • limit — Max number of results to return. Ignored when returnAll is true. Min 1, max 1000. Defaults to 50.
  • page — Page number to return, starting from 1. Ignored when returnAll is true. Defaults to 1.
  • aggregate — Whether to return a single object with items array and totalCount instead of separate items. Defaults to false.
  • sortBy — Field to sort results by. Options: createdAt, key, size, updatedAt. Defaults to createdAt.
  • sortOrder — Order of sorting. Options: asc (lowest to highest), desc (highest to lowest). Defaults to asc.

Output shape

When aggregate is false: array of record objects (page-indexed when returnAll is false, all pages when returnAll is true). When aggregate is true: single object { items: [], totalCount: number } reflecting all retrieved records.

Pagination is handled server-side via page and limit query parameters. Maximum 1000 items per request. Sorting is applied via sortBy and sortOrder query parameters.

Examples

Example 1: Get up to 20 records from the 'invoices' category, page 1.

category: invoices; returnAll: false; limit: 20; page: 1

Example 2: Get all records from the 'invoices' category aggregated with counts.

category: invoices; returnAll: true; aggregate: true

Links

Discussion