I would like to read data from remote mongo database server. I tried by below ways.
ssh username@hostname "mongo databaseName --eval 'db.collection.find({\"params1\":\"2\",\"params2\":\"2\"})'"
or
ssh username@hostname "mongo databaseName --eval 'printjson(db.collection.find({\"params1\":\"2\", \"params2\":\"2\"}))'"
I used both ways, but I can't get the correct result output from database server. How should I do ?