My shell script is :
#! /bin/sh
mongo --host 127.0.0.1 << EOF
use data
db.agent.updateMany({},{$set: {“incoming”:-99}})
exit
EOF
On executing this script I get the following error:
E QUERY [thread1] SyntaxError: invalid property id @(shell):1:32
The same commands when run individually on mongo shell execute successfully with the following output
{ “acknowledged” : true, “matchedCount” : 5, “modifiedCount” : 1 }