mongodb query regex code example
Example 1: mongodb regex
{ : { $regex: /pattern/, $options: '' } }
{ : { $regex: 'pattern', $options: '' } }
{ : { $regex: /pattern/ } }
Example 2: "compass" mongodb filter or search regex
{
email: RegExp('@gmail.com$', 'i')
}