Log file Viewer
Help
|
Karma
| Search:
#mongodb logs for Sunday the 17th of May, 2020
(
Back to #mongodb overview
) (
Back to channel listing
) (
Animate logs
)
[
14:51:31
] <
Aquazi
> hello, struggling a bit with search queries
[
14:52:20
] <
Aquazi
> in mongodb driver, if I want to search for a specific field value, I'd do {field: query}
[
14:52:39
] <
Aquazi
> say the value is a string and I want to search for a partial value
[
14:53:03
] <
Aquazi
> I'd do { field: { $regex: query } }
[
14:53:31
] <
Aquazi
> but what if I want an exact case insensitive match?
[
14:54:24
] <
Aquazi
> so let's say the string in my db is "foobar", and I want any of the following: "FoObar", "FOOBAR", "fooBaR", etc to be matches
[
14:54:49
] <
Aquazi
> but "foobar " or "f" or "foob" should not be matches
[
14:58:51
] <
Aquazi
> https://mongoplayground.net/p/18D3UyK2ihU