Hi, I want to filter a text field and match against part of a word (LIKE in sql). Is it possible to do this in the Documents tab ? I could not find any documentation / examples on the mongo website.
Thanks
Hi @Jon_C,
You can use regular expressions in your filter criteria within Compass. Regular expressions provide a superset of SQL’s LIKE
functionality with more advanced pattern matching options similar to REGEXP
functions in SQL.
For example: {myfield:/pattern/}
would perform a case-sensitive substring match for the given pattern.
I would draw your attention to the Index Use information on regular expressions, as many regular expression queries cannot use indexes effectively.
Some useful references that may make your SQL experience more relatable:
Regards,
Stennie
1 Like
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.