Is there a way to confirm, in a shell script code, that a remove command has removed data?
I have the following bash code
query="db.external_outbox_received_history.remove({ \"exp_date\":{\"\$lte\":1351987200000,\"\$gte\":1351814400000}})"
host="hostname"
db="database"
port=23234
return=`mongo ${host}:${port}/${db} --eval "$query" `
how can I see that the data was in fact removed or something wrong happened and the data could not be removed?
maybe something like this
//pseudo code
if(return==true)
success
else
handler
fi