Using QueryBuilder how to get Nested ArrayObject

Hi, I am new to couchbase.lite, Can anyone help me how to get arrayobject based on condition.

Excepted: I want codes[0] array object when code =1
Query -

var query = QueryBuilder.Select(SelectResult.Expression(Meta.ID), SelectResult.All())
                                    .From(DataSource.Database(database))
                                    .Where(Expression.Property("$Type")
                                                     .EqualTo(Expression.String("Type1"))
                                                     .And(Expression.Property("Codes")
                                                                    .In(Expression.Property("Code")).EqualTo(Expression.Int(1))))
                                    .Limit(Expression.Int(1));

my json document format is

{
  "Id": "TestDocument",
  "$Type": "Type1",
  "Items":["One", "Two"]
  "Codes": [
    {
      "DocType": "DocumentType1",
      "Code": 1,
      "ConfigurationCode": 0,
      "Name": "DocumentType Name"
    },
    {
      "DocType": "DocumentType2",
      "Code": 2,
      "ConfigurationCode": 0,
      "Name": "DocumentType Name"
    }   
      ]
}

You want an “Any” expression to search inside the Codes array.
Sorry, I’m not fluent in the public query API so I can’t tell you the exact syntax to use for that. Check the docs.

Note that searching inside arrays like that is not currently indexable, so your query may be slow. Is there a reason you need to put all those ‘Codes’ entries in a single document? If you make them separate documents you can index the ‘Code’ property.