Skip to content

Commit ec7b5e6

Browse files
committed
comments
1 parent 7075530 commit ec7b5e6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

examples/test-unix-socket-peer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,24 @@ async function main(){
138138
user.on('value', (doc)=>{ console.log('client event [document.on(value)]') })
139139
user.on('remove', (obj)=>{ console.log('client event [document.on(remove)]') })
140140

141+
//! watch remote changes
141142
await user.watch()
142143

144+
//! The server finds the document
143145
let localUser = (await party.find()
144146
.type('user')
145147
.where('name').equals('tester')
146148
.exec())[0]
147149

150+
//! The server changes the document
148151
console.log('\nserver changing document field')
149152
localUser.data.name = 'renamed-tester'
150153
await localUser.save()
151154

152155
console.log(localUser.data)
153156
console.log('hash',localUser.hash)
154157

158+
//! The server deletes the document
155159
await localUser.remove()
156160
}
157161

0 commit comments

Comments
 (0)