Get Many Users

Use this method to get multiple users' metadata simultaneously, such as the name, bio, social link, etc.

Usage in your script

const response = await altura.getUsers();

// customize options
const options = {
  perPage: 20,
  page: 1,
  sortBy: 'name',
  sortDir: 'asc'
}
const response = await altura.getUsers(options);

// filter documents by any properties
const response = await altura.getUsers(
  {}, // default options
  {
    name: 'AlturaNFT'
  } //fetching users with name AlturaNFT
)

const users = response.users;
const userCount = response.count;

Parameters

ParameterTypeRequiredDescription

perPage

String

Yes

Amount of users per page.

page

String

Yes

Amount of pages

sortBy

String

Yes

The field to sort the users by (any field in the user schema may be used)

sortDir

String

Yes

Choose to sort in ascending (asc) or descending (desc) order

Last updated