mongodb - How to delete depricated string fields in options document? -


lets have collections 'testcol' document validation options in options document.

{      "name" : "testcol",      "type" : "collection",      "options" : {          "validator" : {              "$or" : [                  {                      "phone" : {                          "$type" : "string"                      }                  },              ]          },          "validationlevel" : "moderate",          "validationaction" : "error"      },      ... } 

lets want delete these options (i aware can set 'validationlevel' 'off'). can run db.runcommand('colmod'': testcol', validator: {}) , mongodb delete field 'validator' options document. can't same 'validationlevel' , 'validationaction'. db.runcommand('colmod'': testcol', validationlevel: ''), not change leaves me this:

{         "name" : "testcol",         "type" : "collection",         "options" : {             "validationlevel" : "moderate",             "validationaction" : "error"         },         ... } 

this unclean! there way rid of deprecated string-field options or way manipulate/access options document of collection directly?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -