File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments