> EDITOR="cat > /tmp/x.json" > x = db.MyCollection.find(...).toArray() > edit x >
mongo localhost:27020/miscdb --eval "printjson(db.collection_name.findOne({}))" > sample.json