Skip to content

Commit

Permalink
Merge pull request #221 from FrankSalad/v3-exists-fn
Browse files Browse the repository at this point in the history
V3 exists fn
  • Loading branch information
auser authored Jan 26, 2017
2 parents b395e26 + 0ad1159 commit 7de26d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/api/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ firestack.database()
});
```

Test value exists at location:
```javascript
firestack.database()
.ref('posts/1234')
.on('value', (snapshot) => {
const exists = snapshot.exists();
});
```

Basic write with priority example:
```javascript
firestack.database()
Expand Down
1 change: 0 additions & 1 deletion lib/modules/database/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default class Snapshot {
this.ref = ref;
this.key = snapshot.key;
this.value = snapshot.value;
this.exists = snapshot.exists || true;
this.priority = snapshot.priority === undefined ? null : snapshot.priority;
this.childKeys = snapshot.childKeys || [];
}
Expand Down

0 comments on commit 7de26d3

Please sign in to comment.