mongodb check exists on mac code example
Example 1: mongodb exists and not null
db.collection1.find({ 'fieldname1' : { $exists: true, $ne: null } });
Example 2: check if mongodb is running mac
ps -ef | grep mongod | grep -v grep | wc -l | tr -d ' '