'MongoDB how to change object to normal field

I want to take off Object field status_approve and take out the value in it. ex document ==>

    {
      "_id" : ObjectId("....."),
      "status" : 8,
      "status_approve" : {
          "red" : 1,
          "green" : 0,
          "pink" : 4,
          "black" : 0
         },
      "status_duplicate" : 0
    }

change to

     {
        "_id" : ObjectId("....."),
        "status" : 8,
        "red" : 1,
        "green" : 0,
        "pink" : 4,
        "black" : 0,
        "status_duplicate" : 0
    }

field in object status_approve will be moved outside



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source