Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. insertArr = [
  2. [
  3. '_id' => new \MongoDB\BSON\ObjectId(),
  4. 'name' => 'teste
  5. ]
  6. ];
  7.  
  8. $collection = $this->mongo->webapp->hosting;
  9. $collection->updateOne(
  10. ['_id' =>new \MongoDB\BSON\ObjectId($hostingId), 'rooms._id' => new \MongoDB\BSON\ObjectId($roomId)],
  11. ['$push' => ['rooms.$.media' => ['$each' => $insertArr ]]]
  12. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement