mongoDB Validations: How to apply mongoDB validation for Multiple elements of json of Array.

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hi Team,

      I might have posted the question with incorrect components or may be project. But the question is regarding validation feature in mongoDB. Please help me on it.

      Question:
      If I enable mongoDB validation using mongoShell for json of array element then the validation works only if I pass one element as json in the array. However if I pass multiple elements in array for insert/update then validation do not work properly, In this case invalid data is also allowed.

      I have done rigorous search about it and could not find anything helpful.

      Please let me know how to apply validation for multiple elements for array of json for insert/update. Validation is a great feature in mongoDB and I would like to keep it using.

      Thanks.

              Assignee:
              Kelsey Schubert
              Reporter:
              monika
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: