如何使用php从mongodb文件中删除或删除数组数据

Here are the JSON i want to delete { points: 55, bonus: 20 } from points

{
       _id: 3,
       name: "ahn",
       age: 22,
       type: 2,
       status: "A",
       favorites: { artist: "Cassatt", food: "cake" },
       finished: [ 6 ],
       badges: [ "blue", "red" ],
       points: [
          { points: 81, bonus: 8 },
          { points: 55, bonus: 20 },
          { points: 56, bonus: 25 }
       ]
}

I want to see this result

{
       _id: 3,
       name: "ahn",
       age: 22,
       type: 2,
       status: "A",
       favorites: { artist: "Cassatt", food: "cake" },
       finished: [ 6 ],
       badges: [ "blue", "red" ],
       points: [
          { points: 81, bonus: 8 },
          { points: 56, bonus: 25 }
       ]
}

You can use $pull of MongoDB

    db.collection.update(
      { },
      { $pull: { points:  { points: 55, bonus: 20 } } },
    )

{multi: true}: adding this in above query will delete all entries matching { points: 55, bonus: 20 }

collection->update(array("_id"=>$document["_id"]),array('$pull'=>array("points"=>array("points"=>55,"bonus"=>20)));

In PHP using this code to remove documents from document