0

I'm looking for a method that is like equalsIgnoreCase, only in Bson Filters.

At the moment I use Filters.eq (" tag ", tag) only I want a method where the tag can also be case sensitive, but still comes true. So, so to speak, equalsIgnoreCase if you understand what I mean.

return collection.find(Filters.eq("tag", tag)).first() != null;

  • Take a look at [regex](https://docs.mongodb.com/manual/reference/operator/query/regex/index.html#regex), [collation](https://docs.mongodb.com/manual/reference/collation/index.html#collation), and [$text](https://docs.mongodb.com/manual/reference/operator/query/text/index.html#text) – Joe Apr 20 '20 at 04:05

1 Answers1

0

I believe you need to use regex for that. Here is a similar issue:

https://stackoverflow.com/a/1863452/2241072

relativelyPrime
  • 151
  • 1
  • 8