Answers for "print from mongo console to file sample.json"

0

print from mongo console to file sample.json

mongo localhost:27020/miscdb --eval "printjson(db.collection_name.findOne({}))" > sample.json
Posted by: Guest on April-30-2021
0

print from mongo console to file

> EDITOR="cat > /tmp/x.json"
> x = db.MyCollection.find(...).toArray()
> edit x
>
Posted by: Guest on April-30-2021

Browse Popular Code Answers by Language