Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions firebase-database-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@
'__onlineChanged(online)'
],

/**
* Remove all data at the current query location.
*
* **Note:** This will remove *all* data at the path of this
* query, regardless of whether it is visible given the current
* query parameters.
*/
remove() {
return this.ref.remove();
},

_setFirebaseValue: function(path, value) {
this._log('Setting Firebase value at', path, 'to', value)
var key = value && value.$key;
Expand Down
28 changes: 27 additions & 1 deletion firebase-query.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,34 @@
this.__queryChanged(null, this.query);
},

/**
* Returns the data of the child with the specified key.
*
* **Note:** Will return `null` for any child that is not
* matched **by the current query parameters**.
*/
child: function(key) {
return this.__map[key];
return this.__map[key] || null;
},

/**
* Push a new item onto the path of this query.
*
* **Note:** If the data pushed does not match current query
* parameters, it will not appear in `data`.
*/
push(data) {
return this.ref.push(data);
},

/**
* Remove a child by its specified key.
*
* **Note:** The child matching the specified key will be
* removed whether or not it is visible in the current query.
*/
removeChild(key) {
return this.ref.child(key).remove();
},

get isNew() {
Expand Down