How do I match a field but ignoring dots in a find query?

I want to make a query similar to this Microsoft SQL Server query:

SELECT * FROM Document WHERE REPLACE(Field,'.','')=REPLACE(@Search,'.','')

Basically I want to find all documents where a field matches a search parameter but ignoring all dots.
Any help please?

You can replace dots using $replaceAll

db.collection.aggregate( [ { $set: { newField: { $replaceAll: { input: "$field", find: ".", replacement: "" } } } }, { $match: { newField: "searchString" } } ])