Is there a limit to how many filters can be used?

Hello again!

I was wondering if there is a limit to how many filters you can use in a query, specifically the “any” filter.

For example, a dexTrade with an array of currencies:

any: [{baseCurrency: {is: "xyza"}}
      {baseCurrency: {is: "xyzb"}},
      {baseCurrency: {is: "xyzc"}},
      {baseCurrency: {is: "xyzd"}},
      {baseCurrency: {is: "xyze"}},
      {baseCurrency: {is: "xyzf"}},
      {baseCurrency: {is: "xyzg"}},
      {baseCurrency: {is: "xyz"h}}]

Is this approach faster than using “in”?

any: [{baseCurrency: {in: ["xyza", "xyzb", "xyzc", ""xyzd"]}}

And is that any different from not using “any”?

{baseCurrency: {in: ["xyza", "xyzb", "xyzc", ""xyzd"]}

Thank you!

I don’t think there is any difference in approaches 2 and 3.

However, if you want all the currencies in the base currency, then try this.

{baseCurrency: {notIn: ["tttt"]}

I’ve noticed that specifying the array really helps execution time, but it seems like there is a limit to how many filters can be in the array. Is that the case? I tried with 30 as an experiment and it worked, but above 30 it started to return error 500.

Flip the query.

Rather than using “in” to get all, use “notin” to get all.