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

    Is there any way to search for registrations based off of username (or registration data)?

    Scheduled Pinned Locked Moved
    Q&A
    0
    2
    295
    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.
    • joshuaJ
      joshua
      last edited by

      Q: Is there any way to search for registrations based off of username (or registration data)?

      1 Reply Last reply Reply Quote 0
      • joshuaJ
        joshua
        last edited by

        If you are using Elasticsearch yes..

        If you want to search for a username in a particular registration (for a particular application)

        {
          "bool" : {
            "must" : [ {
              "bool" : {
                "must" : [ {
                  "nested" : {
                    "path" : "registrations",
                    "query" : {
                      "bool" : {
                        "must" : [ {
                          "match" : {
                            "registrations.applicationId" : "3c219e58-ed0e-4b18-ad48-f4f92793ae32"
                          }
                        }, {
                          "match" : {
                            "registrations.username" : "bob"
                          }
                        } ]
                      }
                    }
                  }
                } ]
              }
            } ]
          }
        }
        

        Where the value for registrations.applicationId is the Id of your application and the username you are looking for is bob.

        If you only wanted to search for a user with a username of bob you could just search on registrations.username:bob - but this would not limit the search to any particular application registration.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post