Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-1322

Add support for validator when creating collection.

    Details

      Description

      db.createCollection( "contacts", {
         validator: { $or:
            [
               { phone: { $type: "string" } },
               { email: { $regex: /@mongodb\.com$/ } },
               { status: { $in: [ "Unknown", "Incomplete" ] } }
            ]
         }
      } )
      

      NOTE: investigate usage if JSR-303 for defining validation to be propagated to the collection.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cstrobl Christoph Strobl
                Reporter:
                cstrobl Christoph Strobl
                Last updater:
                Oliver Drotbohm
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: