How to export json from Mongodb using robomongo


How to export json from Mongodb using robomongo : - For larger collections it is not encouraged to use the following.
records = [];
var cursor = db.getCollection('collectionName').find({}, {});
while(cursor.hasNext()) {
    records.push(cursor.next())
}
print(tojson(records));

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days