Skip to content

Commit 2a857d7

Browse files
committed
Update Readme
1 parent c5cc9df commit 2a857d7

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

README.markdown

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Please see the example in `examples/example.js`. Or here for reference:
2323
var DDPClient = require("ddp");
2424

2525
var ddpclient = new DDPClient({
26-
host: "localhost",
26+
host: "localhost",
2727
port: 3000,
2828
/* optional: */
2929
auto_reconnect: true,
@@ -39,17 +39,17 @@ ddpclient.connect(function(error) {
3939
console.log('DDP connection error!');
4040
return;
4141
}
42-
42+
4343
console.log('connected!');
44-
44+
4545
ddpclient.loginWithUsername("myusername","ddp-rocks",function(err, result) {
4646
//Do stuff after login
4747
});
48-
48+
4949
ddpclient.call('test-function', ['foo', 'bar'], function(err, result) {
5050
console.log('called function, result: ' + result);
5151
})
52-
52+
5353
ddpclient.subscribe('posts', [], function() {
5454
console.log('posts complete:');
5555
console.log(ddpclient.collections.posts);
@@ -63,7 +63,7 @@ ddpclient.on('message', function(msg) {
6363
console.log("ddp message: " + msg);
6464
});
6565

66-
/*
66+
/*
6767
* If you need to do something specific on close or errors.
6868
* (You can also disable auto_reconnect and call ddpclient.connect()
6969
* when you are ready to re-connect.)
@@ -75,6 +75,13 @@ ddpclient.on('socket-close', function(code, message) {
7575
ddpclient.on('socket-error', function(error) {
7676
console.log("Error: %j", error);
7777
});
78+
79+
/*
80+
* If use_ejson is true and you need access to the EJSON object:
81+
*/
82+
83+
var oid = new ddpclient.EJSON.ObjectID();
84+
7885
```
7986

8087
Unimplemented Features
@@ -99,3 +106,4 @@ Contributions:
99106
* Mike Bannister (@possiblities)
100107
* Chris Mather (@eventedmind)
101108
* James Gill (@jagill)
109+
* Vaughn Iverson (@vsivsi)

0 commit comments

Comments
 (0)