Skip to content

Commit 7de26d3

Browse files
authored
Merge pull request #221 from FrankSalad/v3-exists-fn
V3 exists fn
2 parents b395e26 + 0ad1159 commit 7de26d3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: docs/api/database.md

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ firestack.database()
2525
});
2626
```
2727

28+
Test value exists at location:
29+
```javascript
30+
firestack.database()
31+
.ref('posts/1234')
32+
.on('value', (snapshot) => {
33+
const exists = snapshot.exists();
34+
});
35+
```
36+
2837
Basic write with priority example:
2938
```javascript
3039
firestack.database()

Diff for: lib/modules/database/snapshot.js

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default class Snapshot {
2222
this.ref = ref;
2323
this.key = snapshot.key;
2424
this.value = snapshot.value;
25-
this.exists = snapshot.exists || true;
2625
this.priority = snapshot.priority === undefined ? null : snapshot.priority;
2726
this.childKeys = snapshot.childKeys || [];
2827
}

0 commit comments

Comments
 (0)