Hello, I’ve tried used php library bulk upsert data value “$$ emoji” has throw error.
I also tried data value “$ emoji” also got unable to upsert.
Below is the code example.
$uri = 'mongodb://localhost:27017/?retryWrites=true&w=majority';
$client = new \MongoDB\Client($uri);
$collection = $client->selectDatabase('test')->test;
$result = $collection->bulkWrite([
[
'updateOne' => [
[
'unique_id' => '249993de9982967b2950a42ad651e2d7'
],
[
[
'$set' => [
'remark' => '$$ emoji'
]
]
],
[
'upsert' => true
]
]
]
]);
db.test.bulkWrite([
{
"updateOne": {
"filter": {"unique_id": "b4f5393a3a7f822eabd3d6eead66e533"},
"update": [
{ "$set": { "remark": "$$ emoji" } }
],
"upsert": true
}
}
]);