FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    how can I get an exact number of users with some attributes?

    Scheduled Pinned Locked Moved Solved
    Q&A
    search
    1
    2
    58
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danD
      dan
      last edited by

      How can I get an exact number of users with some attributes? I'm using elasticsearch.

      --
      FusionAuth - Identity Without Constraints
      https://fusionauth.io

      danD 1 Reply Last reply Reply Quote 0
      • danD
        dan @dan
        last edited by

        You want to use search parameters like those outlined in this sample script.

        • use a key limited to POST on /api/user/search
        • set accurateTotal on the request
        • set numberOfResults to 1 on the request

        In the response, look at the total field.

        This will let you get exact numbers while reducing load on your instance.

        --
        FusionAuth - Identity Without Constraints
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • danD dan has marked this topic as solved
        • First post
          Last post