ktamas77 / firebase-php

Firebase PHP Client
792 stars 215 forks source link

Trouble with set and update operations #67

Open ashishmacherla opened 7 years ago

ashishmacherla commented 7 years ago

Hello Katmass77 Team, I am currently implementing the get,push,update and set operations for my web application, and encountered the following problems:

  1. With push operation I can successfully push the data to the firebase. But, when pushing the data, rather than having a randomkey generated, is there a way to specify my own(customized) key when performing the push operation? The call to the operation from my model layer is: $this->firebase->push(FirebasePath::BRANDS.$this->brandId.self::CATEGORIES,$allCategories['value']);

where $allCategories is: array ( 'name' => 'brand_categories', 'value' => 'cid1,cid2'
)
brands push operation

  1. When performing the set and update operations, instead of updating/setting, the operations is deleting the entire tree from categories till its child (see the image below). Note: where 81dc9bdb52d04dc20036dbd8313ed055 is the brandId of every brand we have brands set

Can you suggest us if we are implementing in a wrong way or is there a problem with the framework.

dade80vr commented 7 years ago

Following..