diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e926350..2d080bd2 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ [Firebase Android SDK Changelog](https://firebase.google.com/support/release-notes/android) +## 5.0.0 (work in progress) + +### New +- [#547](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/547) Add a 'getValue' function to mimic the Web API's 'once' + + ## 4.2.1 (2017, October 24) ### Fixes diff --git a/docs/DATABASE.md b/docs/DATABASE.md index ead7c986..8a9cd61b 100644 --- a/docs/DATABASE.md +++ b/docs/DATABASE.md @@ -40,6 +40,15 @@ The plugin will take care of serializing JSON data to native data structures. ); ``` +### getValue +To just get a value at a certain path 'once', use this convenience method: + +```js + firebase.getValue('/companies').then(function(result) { + console.log(JSON.stringify(result)); + }); +``` + #### Adding an update timestamp If you want to have Firebase a timestamp to your data (instead of clients which likely are not synchronized), you can use the placeholder value `firebase.ServerValue.TIMESTAMP` (or `firebase["ServerValue"].TIMESTAMP` if your IDE complains about the former), so for instance: