Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- insertArr = [
- [
- '_id' => new \MongoDB\BSON\ObjectId(),
- 'name' => 'teste
- ]
- ];
- $collection = $this->mongo->webapp->hosting;
- $collection->updateOne(
- ['_id' =>new \MongoDB\BSON\ObjectId($hostingId), 'rooms._id' => new \MongoDB\BSON\ObjectId($roomId)],
- ['$push' => ['rooms.$.media' => ['$each' => $insertArr ]]]
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement