Simple life, Complicated mind
Sunday, July 23, 2017
Execute mongo commands through shell scripts
Method 1:
# mongo DBName --quiet --eval 'db.users.find().pretty()' | less
Method 2:
# echo -e 'use DBName\ndb.users.find().pretty()' | mongo --quiet
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment