@steevej $and is short-circuit, it’s probably failing on the timestamp and never reaches the $regex.
@Alfred_D_Souza I think your $regex is malformed. See https://www.mongodb.com/docs/manual/reference/operator/query/regex/
3 forms of $regex are listed there and your code seems to mix the forms and does not conform closely to any 1 of the 3:
{ <field>: { $regex: /pattern/, $options: '<options>' } }
{ "<field>": { "$regex": "pattern", "$options": "<options>" } }
{ <field>: { $regex: /pattern/<options> } }
E.g., you should try:
{error: {$regex: /Contains invalid characters/}}
or
{"error": {"$regex": "Contains invalid characters", "options": ""}}