How do I describe a collection in Mongo?

前端 未结 12 626
终归单人心
终归单人心 2021-01-31 02:32

So this is Day 3 of learning Mongo Db. I\'m coming from the MySql universe...

A lot of times when I need to write a query for a MySql table I\'m unfamiliar with, I woul

12条回答
  •  花落未央
    2021-01-31 02:43

    While factually correct, you're all making this too complex. I think the OP just wants to know what his/her data looks like. If that's the case, you can just

    db.collectionName.findOne()
    

    This will show one document (aka. record) in the database in a pretty format.

提交回复
热议问题