Syntax
First, import the MantaClient from the library, see Getting Started:
Parameters
The fetchAllRecords() method object can contain the following properties:
Field selection
Using the fields parameter, you can specify exactly which fields you want to return from each record. This reduces the response payload and improves application performance.
Filtering
The where parameter allows you to retrieve a subset of records by specifying filter conditions. You can use simple equality checks or a variety of powerful operators to build your query.
Pagination
The page and list parameters allow you to control how many records to fetch and which page to return. This is crucial for handling large datasets efficiently by retrieving them in smaller, manageable chunks.
Search
The search parameter allows you to perform a keyword search across one or more columns in your table.
Sorting
Use orderBy and order to sort your results by a specific field.
Relationships
You can include related data from other tables using the with parameter.
Error handling
Learn how to handle errors when using the fetchAllRecords() method in Manta.
Examples
This section provides various examples demonstrating how to use the fetchAllRecords() method to perform common queries.