I am trying to manually fix some documents in my Mongo database which contain the Unicode replacement character (looks like a question mark, see http://www.fileformat.info/info/unicode/char/fffd/index.htm). I already fixed the issue why these characters ended up there but would like to keep the old data too. So all I want is a simple query which returns all documents containing this character.
What I came up with so far is
db.songs.find({artist: /\ufffd/});
to find all songs with an artist name containing the replacement character. No luck so far.
Seems it doesn't like \uXXXX in the regexp. Try:
db.songs.find({artist: new RegExp("\ufffd")});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With