How to retrieve MongoDb collection validator rules?

前端 未结 1 917
生来不讨喜
生来不讨喜 2021-02-20 00:43

On MongoDB 3.4.4 I\'ve created a collection with a validator, but now some inserts fail this rules and I can\'t understand why.

  1. Is there a way to output the rules
相关标签:
1条回答
  • 2021-02-20 01:22
    1. You can see the validation rules (among other collection information) with db.getCollectionInfos() for all collections or db.getCollectionInfos({name: "myCollection"}) for a specific collection: MongoDB docs

    2. Have a look at this answer.

    0 讨论(0)
提交回复
热议问题