# Is it possible to use the Management V2 /api/v2/users endpoint to query objects in an array

**URL:** <https://community.auth0.com/t/is-it-possible-to-use-the-management-v2-api-v2-users-endpoint-to-query-objects-in-an-array/7349>\
**Category:** Get Help\
**Tags:** users, search, lucene, q, management-api\
**Created:** [July 1, 2017, 12:24am UTC](https://community.auth0.com/t/is-it-possible-to-use-the-management-v2-api-v2-users-endpoint-to-query-objects-in-an-array/7349 "2017-07-01T00:24:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emanuel.williams](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emanuel.williams/32/12752_2.png) [@emanuel.williams](https://community.auth0.com/u/emanuel.williams)\
**Post date:** [July 1, 2017, 12:24am UTC](https://community.auth0.com/t/is-it-possible-to-use-the-management-v2-api-v2-users-endpoint-to-query-objects-in-an-array/7349/1 "2017-07-01T00:24:37Z")

</div>

```
Lets assume I have an app metadata structure like so : 
{
  "Tenants": 
    {
      "Name": "testCust",
      "permissions": {
        "groups": 
          "Owner",
          "User",
          "Tester"
        ]
      }
    },
    {
      "Name": "realCust",
      "permissions": {
        "groups": 
          "Owner",
          "Marketing",
          "Driver"
        ]
      }
    }
 }

```

Is there anyway for me to query this structure using the q parameter to find all Users containing a Tenant with name testCust and has the group Owner?

I already tried  
app\_metadata.Tenants.Name:testCust AND app\_metadata.Tenants.permissions.groups: Owner

But that returns all users who have ANY tenant with the name testCust and ANY tenant with the permission Owner.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 5, 2017, 4:35pm UTC](https://community.auth0.com/t/is-it-possible-to-use-the-management-v2-api-v2-users-endpoint-to-query-objects-in-an-array/7349/2 "2017-07-05T16:35:10Z")

</div>

To my knowledge, that is not possible; you may consider if doing additional filtering at the client application level is an acceptable workaround.

The query syntax supported is documented [here](https://auth0.com/docs/api/management/v2/query-string-syntax) and if you follow the additionally linked docs you’ll notice this syntax is in fact the [Lucene Query Syntax](http://www.lucenetutorial.com/lucene-query-syntax.html) which would not support that use case as that would require the ability to represent a query in a single nested object which the query string syntax does not support.

Additional information:

- [Is it possible to search nested objects in ElasticSearch with the lucene query syntax? - Stack Overflow](https://stackoverflow.com/questions/35353952/is-it-possible-to-search-nested-objects-in-elasticsearch-with-the-lucene-query-s)
- [https://github.com/elastic/elasticsearch/issues/11322](https://github.com/elastic/elasticsearch/issues/11322)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/is-it-possible-to-use-the-management-v2-api-v2-users-endpoint-to-query-objects-in-an-array/7349/3 "2018-03-02T05:55:06Z")

</div>


