Hello my Database looks like this:

"delivery_pincode": [
{
"item_id": "106380730",
"item_text": "560074"
},
{
"item_id": "119323097",
"item_text": "562164"
},
{
"item_id": "126726811",
"item_text": "560050"
},
{
"item_id": "129564907",
"item_text": "560115"
}
]
Provided in the image and I want to fetch data in which I have added code
.where("delivery_pincode","array-contains-any" , pincode)
where pincode is "560074" so the result is giving empty array . I have also tried with code
.where("delivery_pincode","array-contains-any" , [item_text: "560074"])
which is again giving empty array . any solution to fetch data based on item_text's pincode ?
The array-contains and array-contains-any operators check whether the value you passed matches a complete item in the array; they can't be used to match a subset of an item.
So with your current data structure, you will have to use this query:
.where("delivery_pincode","array-contains", {"item_id": "106380730",item_text: "560074"})
If you don't know all properties of the item, the common workaround to allow your use-case is to add an additional array field with just the values you do know, and then query on that.
So for you that would be a field delivery_pincode_item_texts:
delivery_pincode_item_texts: [
"560074",
"562164",
"560050",
"560115"
]
You can then query that with:
.where("delivery_pincode_item_texts","array-contains-any", ["560074"])
or
.where("delivery_pincode_item_texts","array-contains", "560074")