title: The opeartor set doesn't work in mongodb. Or any other methods to add a new field into the document?
body: <p><em>The operator <strong>$set</strong> can't add a new field <strong>hide</em></strong>. I thought, I was doing everything according to the mongodb official documentation. Can somebody tall me what I'm doing wrong. Thanks</p>
  
  <pre><code>  createClass
      .updateMany(
        { classname: req.body.className },
        { $set : {"hide":true}},
        { multi: true, upsert: false },
      )
  </code></pre>
  
  <p>Here is the schema:</p>
  
  <pre><code>const mongoose = require("mongoose");
  const Schema = mongoose.Schema;
  const Classes = new Schema({
    classname: {
      type: String,
      required: true,
    },
    Subject: {
      type: String,
      required: true,
    },
    Chapter: {
      type: String,
      required: true,
    },
    Topic: {
      type: String,
      required: true,
    },
    SubjectimgPath: {
      type: String,
    },
    ChapterimgPath: {
      type: String,
    },
    TopicimgPath: {
      type: String,
    },
    content: {
      type: Array,
    }
  });
  
  Classes.index({ "$**": "text" });
  
  const Createclass = mongoose.model("AllClasses", Classes);
  
  module.exports = Createclass;
  
  </code></pre>