Find the distinct values under the nested type

I am trying to group the distinct values under the nested type. I am having hard time finding the query for this. Any suggestions would be appreciated.

My data looks like below:

[
{
  objectID: "xxx",
  admin : {
      "org" : "123"
  },
  info : {
    ...
    "ID" : "000"
    ...
  }
},
{
  objectID: "xxx_x",
  admin : {
      "org" : "123"
  },
  info : {
    ...
    "ID" : "001"
    ...
  }
},
{
  objectID: "xxx_xx",
  admin : {
      "org" : "234"
  },
  info : {
    ...
    "ID" : "111"
    ...
  }
}
]

For the above data, I am trying to get all the distinct "info ID's" for the given "admin org".

As org is in one nested type (admin)
and info ID is another nested type (info).. I do not understand how to achieve the result.

The result I am looking for is something like:

{
  org : 123 ,         
  IDs : [000, 001]
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.