Applying wixData Query filters to Object type fields in Collections question

Hi,
I come from using postgreSQL, in postgreSQL, we are able to make queries on the JSON object columns directly. Is there a way for velo’s wixData to do the same?

Here is what my object field looks like in my collection:


I would like to check whether or not each array inside this object is empty or not using wixData’s queries and filter results based upon this condition.

Yes, you can run a query on JSON object. Just instead of using .eq(‘field’, val) use .eq(‘field.key’, val)

great it worked! thanks alot!

But it doesn’t work my side with “Stores/Orders” collection. Consider the code below:

let r = await wixData.query(“Stores/Orders”).eq(“billingInfo.email”, “Test@abcd.com”)
.find(cl_opt)
.then((result) => {
console.log(result);
return result;
})
.catch((err) => {
console.log(err);
});

The above code generates error, “Validation failed: filter parser Unknown token billingInfo.email”.

Here “billingInfo.email” exists in the collection.