A "\" in a $regex causes The Mongo server and the Meteor query disagree


Anyone else experienced this before?


Any thoughts on why it would happen? Is Meteor trying to escape the H, or removing the “” perhaps?


A quick note, running the query in meteor shell:

MyCollection.find({name: {$regex: "B", $options: "i"}}).fetch().length; \\ 1319

MyCollection.find({name: {$regex: "\\B", $options: "i"}}).fetch().length; \\6071

So it seems Meteor is doing something odd


This looks like it should be posted as an issue on Github:


Looks like the code that causes this might be here:


I have created a github issue: https://github.com/meteor/meteor/issues/10340