How do I describe a collection in Mongo?

前端 未结 12 628
终归单人心
终归单人心 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:34

    If you're OK with running a Map / Reduce, you can gather all of the possible document fields.

    Start with this post.

    The only problem here is that you're running a Map / Reduce on which can be resource intensive. Instead, as others have suggested, you'll want to look at the code that writes the actual data.

    Just because the database doesn't have a schema doesn't mean that there is no schema. Generally speaking the schema information will be in the code.

提交回复
热议问题