Use this method to get metadata of multiple collections at the same time.
Usage in your script
const response = await altura.getCollections();
// customize options
const response = await altura.getCollections({
perPage: 20,
page: 1,
sortBy: 'name',
sortDir: 'asc'
});
// filter documents by any properties
const response = await altura.getCollections(
{}, // Default pagination
{
isVerified: true
} // fetching verified collections only
);
const collections = response.collections;
const collectionCount = response.count;
const response: { collections: IAlturaCollection[], count: number } = await altura.getCollections();
// customize options
const response: { collections: IAlturaCollection[], count: number } = await altura.getCollections({
perPage: 20,
page: 1,
sortBy: 'name',
sortDir: 'asc'
});
// filter documents by any properties
const response: { collections: IAlturaCollection[], count: number } = await altura.getCollections(
{}, // Default pagination
{
isVerified: true
} // fetching verified collections only
);
const collections = response.collections;
const collectionCount = response.count;
Parameters
Parameter
Type
Required
Description
The number of collections to return
The offset for returned collections. Calculated as (page - 1) * perPage
The field to sort the collections by (any field in the collection schema may be used)
Choose to sort in ascending (asc) or descending (desc) order