I want to know does there is any way in which i can delete mongo collections based on number of records i.e when count is 0 delete the collections using shell script
I have tried this
export name=$(mongo test --eval "printjson(db['42QVM_20170701'].count())")
echo $name
but here it return string value with count i.e MongoDB shell version: 3.0.15 connecting to: test 0
i want to know does there is a way where i can automatically drop a collections based on size or count value
`