How to get the size of single document in Mongodb?

前端 未结 5 1546
情歌与酒
情歌与酒 2020-11-28 03:34

I encountered a strange behavior of mongo and I would like to clarify it a bit...
My request is simple as that: I would like to get a size of single document in collect

5条回答
  •  一向
    一向 (楼主)
    2020-11-28 03:54

    Object.bsonsize(db.test.findOne({type:"auto"})) It gives in bytes.

提交回复
热议问题