Unable to limit Get User list

Hi,

I am using @okta/okta-sdk-nodejs (documentation : https://www.npmjs.com/package/@okta/okta-sdk-nodejs) module to access Okta APIs.
I am trying to add limit to query parameter, but unable to do so.
Here is the snippet

client.listUsers({
search: ‘profile.nickName eq “abc 1234”’,
limit : 5
})

Can anyone help ? Its urgent.

Hi @monalizende

I’ve tested now on my end using the following script.

const okta = require('@okta/okta-sdk-nodejs');
 
const client = new okta.Client({
  orgUrl: 'https://org.oktapreview.com',
  token: 'API_TOKEN' 
});

client.listUsers({
  search: 'profile.firstName eq "Test"',
  limit: 1
}).each(user => {
  console.log('User matches search:', user);
});

All the HTTP requests contained the limit parameter as set in the script.

[05/Aug/2019:23:54:10 +0000] "GET /api/v1/users?search=profile.firstName%20eq%20%22Test%22&limit=1 HTTP/1.1"
[05/Aug/2019:23:54:10 +0000] "GET /api/v1/users?after=1&limit=1&search=profile.firstName+eq+%22Test%22 HTTP/1.1"
[05/Aug/2019:23:54:11 +0000] "GET /api/v1/users?after=3&limit=1&search=profile.firstName+eq+%22Test%22 HTTP/1.1"

Please check the response of API call as well. It simply ignores the limit and send all the records. Try to have multiple records matching search criteria and see if numbers of records in response follows the limit provided.