I hope that someone can help me.
I need to create a bash script that connects to a Mongodb:
mongo --host mongodb://IP:PORT,IP:PORT/admin?replicaSet=rs0 -u admin -p passadmin
select the db:
use Data
and launch the query:
db.OPERATIONS.find({"Description":"OK."}).count()
of the last hour, I think it would be something like this:
{$lte: new Date().getTime()-(1*60)}
and save it in a file eg:
/tmp/count.log con el timestamp de la consulta.
Thank you very much in advance. Greetings.