Export a mongodb collection that also brings the size of the document

1

I have the export of a collection that has some documents, I need to export one of these documents and its size. I've tried something like this:

mongoexport -d test -c records -q '{ a: { $gte: 3 } }' --out exportdir/myRecords.json

Do not roll what I need.

Is there a function that returns the size of a document in the mongodb collection?

    
asked by anonymous 15.09.2017 / 17:48

1 answer

1

Carlos the command that returns the number of records is the

db.collection.count()

    
18.09.2017 / 16:07