how to subscribe a document in livedb?

55 views
Skip to first unread message

zhijie huo`

unread,
Apr 21, 2014, 2:33:29 PM4/21/14
to sha...@googlegroups.com
Hi there,

I try the livedb examples and i can create a file and edit it following the demo.

its like 

db = require('livedb-mongo')('localhost:27017/test?auto_reconnect', {safe:true});
livedb = require('livedb').client(db);

livedb.submit('users', 'test', {create:{type:'textv1', data:[1,2,3]}}, function(err, version, transformedByOps, snapshot)
livedb.submit('users', 'test', {op:[{p:["q",0], li:"hello"}], v:1}, function(err) 

the thing is how to subscribe the document so i can get the change? 

thanks

田传武

unread,
Apr 22, 2014, 9:04:05 AM4/22/14
to sha...@googlegroups.com, jethu...@gmail.com
If you are using ShareJS API, see: https://github.com/share/ShareJS/wiki/0.7-Documents#subscriptions
If not, you may need to subscribe to a redis channel, see: http://redis.io/commands/subscribe
Reply all
Reply to author
Forward
0 new messages