I have had the same problem recently after searching for possible solutions. I have come to this
db.test.bulkWrite([
{
"updateOne": {
"filter": {"unique_id": "b4f5393a3a7f822eabd3d6eead66e533"},
"update": [
{ "$set": { "remark": { $literal: "$$ emoji" }} }
],
"upsert": true
}
}
]);
I have carried out satisfactory tests for the case “$$ emoji” and “$ emoji”