I am new to Couchbase Lite so might be asking a really basic question. I have a requirement where I need to use the QueryBuilder
to fetch the data at a property which is nested inside another property. Seems like a pretty straight forward nested query thing but I'm not able to find resources for the same. Consider the following example where I have multiple documents that follow the same document pattern:
{
"user":{
"id": 1,
"metadata": {
"anotherId": 2,
"aRandomArray": [
"Works",
"WorksAsWell"
]
}
}
}
Now, how will the QueryBuilder's query look like if I have to make the query for the following use-cases:
id
is equal to 1anotherId
is equal to 2aRandomArray
contains WorksAsWellSo the question primarily revolves around how to create a query for properties that are nested inside other properties using QueryBuilder?
This question was answered by the Couchbase team on their forum: https://www.couchbase.com/forums/t/use-querybuilder-to-query-on-a-property-that-is-inside-a-nested-json/37295/2?u=shubham.bakshi