Identity Management Aggregate Queries

This topic has 0 replies, 1 voice, and was last updated 3 years, 10 months ago by chris-fry.

  • Author
  • #24034

    Hi all,

    What’s the best way to run simple aggregation queries in an IDM prod environment?

    For example, if I wanted a count of all users with accountStatus of active.

    In SQL, this would be something like:
    S3LECT COUNT(userName) FROM user WHERE accountStatus = 'active'; (had to misspell ‘SELECT’ due to the WAF on this forum)

    I’ve experimented with the API using _queryFilter to get these results, then pulling out the ‘resultCount’ attribute, but it’s returning the data itself as well (which I don’t need or want) and when the record count is high, it takes a long time and often just falls over.


    $ curl \
    >   --header "X-OpenIDM-Username: openidm-admin" \
    >   --header "X-OpenIDM-Password: $password" \
    >   "http://idm.lab.local:9080/openidm/managed/user/?_queryFilter=accountStatus+eq+'active'&_fields=userName&_prettyPrint=true"
      "result" : [ {
        "_id" : "4e90351b-...d83",
        "_rev" : "00000000d83627e3",
        "userName" : "example_user_01"
      } ],
      "resultCount" : 1,
      "pagedResultsCookie" : null,
      "totalPagedResultsPolicy" : "NONE",
      "totalPagedResults" : -1,
      "remainingPagedResults" : -1


    • This topic was modified 3 years, 10 months ago by chris-fry.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?