# shortcut.
which mp
# =>
mp () {
mq=`s2m "$*"`
#echo "__mq: $mq"
mongo [ip]:[port]/[db] --quiet --eval "$mq.forEach(printjson)"
}
# base query
mp "select _id,nickname from user where _id in (100002,100003) order by _id desc limit 10"
# =>
{ "_id" : NumberLong(100003), "nickname" : "就是辣么帅 2323" }
{ "_id" : NumberLong(100002), "nickname" : "下江" }
# special limit
mp "select _id,nickname from user where _id in (100002,100003) order by _id desc limit 1,1"
# =>
{ "_id" : NumberLong(100002), "nickname" : "下江" }
# collaboration with other unix tool
mp "select _id,nickname from user where _id in (100002,100003) order by _id desc limit 10" | b2j | jq .nickname
# =>
"就是辣么帅 2323"
"下江"

NOTE
github