Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the fields that triggered update notifications (#1364)
## What does this PR do ? See the PR title https://jira.kaliop.net/browse/KZL-1127 ### How should this be manually tested? Execute this script and see the notification: ``` const { Kuzzle, WebSocket } = require('kuzzle-sdk'); const kuzzle = new Kuzzle( new WebSocket('localhost') ); function callback (notification) { console.log(notification); } kuzzle.on('networkError', error => { console.error('Network Error:', error); }); const run = async () => { try { await kuzzle.connect(); await kuzzle.document.createOrReplace( 'nyc-open-data', 'yellow-taxi', 'some-id', { capacity: 4, members: 5 }, ); const filters = { exists: 'capacity' }; await kuzzle.realtime.subscribe('nyc-open-data', 'yellow-taxi', filters, callback); const response = await kuzzle.document.update( 'nyc-open-data', 'yellow-taxi', 'some-id', { capacity: 100, members: 50 } ); console.log(response); } catch (error) { console.error(error.message); } finally { kuzzle.disconnect(); } }; run(); ```
- Loading branch information
1 parent
f78aa09
commit 3a69c80
Showing
4 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters