I was reading on how to query in moralis because I have to use something like that however, the docs does not seem to explain what I intend to do and I have been there for close to 2hrs and I seem to catch nothing to use
so my query is suppose to be close to the domo https://v1docs.moralis.io/moralis-dapp/database/queries#queries-on-array-values except in their case the array contained only number in my case it is an array of many objects like this
{
"name":"some name",
"attributes": [
{
"trait_type": "Background",
"value": "Aquamarine",
"rarityScore": 7.912183544303797
},
{
"trait_type": "Fur",
"value": "Gray",
"rarityScore": 20.163306451612904
},
{
"trait_type": "Clothes",
"value": "Pimp Coat",
"rarityScore": 125.0125
},
{
"trait_type": "Mouth",
"value": "Bored Unshaven Dagger",
"rarityScore": 357.1785714285714
},
{
"trait_type": "Eyes",
"value": "Closed",
"rarityScore": 14.105782792665725
},
{
"trait_type": "Hat",
"value": "Bayc Hat Black",
"rarityScore": 43.864035087719294
},
{
"trait_type": "TraitCount",
"value": 6,
"rarityScore": 15.04192517390487
},
{
"trait_type": "Earring",
"value": null,
"rarityScore": 1.4236298932384341
}
],
}
so what am doing is, my query should filter the objects on attributes
where i supply trait_type
and value
I tried
query.equalTo("attributes", filterQuery);
but it does not work coz in my case filterQuery
is an array with different objects each with unique trait_type
and value
and example of filterQuery
am using is
[
{
"trait_type": "Fur",
"value": "Blue"
}
]
will appreciate very much if someone can help me solve this or even an idea on how it is done