mGetUsers

Gets multiple security users.


Copied to clipboard!
mGetUsers(kuids, [options]);

Property Type Description
ids
string[]
User identifiers
options
object
Query options

options

Property Type Description
queuable
boolean
If true, queues the request during downtime, until connected to Kuzzle again
verb
string
(HTTP only) Forces the verb of the API route

verb

When instantiated with a HTTP protocol object, the SDK uses the GET API by default for this API route. You can set the verb option to POST to force the SDK to use the POST API instead.

Resolves

An array of retrieved User objects.

Usage

Copied to clipboard!
try {
  const response = await kuzzle.security.mGetUsers([
    'user1',
    'user2',
    'user3'
  ]);

  console.log(response);
  /*
  [ User {
      _id: 'user1',
      profileIds: ['profile1'],
    User {
      _id: 'user2',
      profileIds: ['profile2'],
    User {
      _id: 'user3',
      profileIds: ['profile3'] ]
   */
} catch (e) {
  console.error(e);
}