Skip to content

Commit

Permalink
docs(add): updated API instructions for add
Browse files Browse the repository at this point in the history
  • Loading branch information
fergiemcdowall committed Jun 23, 2017
1 parent af771a8 commit 3dd796b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 1 addition & 4 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,7 @@ being sent on top of one another then it is safer to use
// s is a Readable stream in object mode
s.pipe(si.defaultPipeline(batchOptions))
.pipe(si.add())
.on('data', function(d) {
// this function needs to be called if you want to listen for the end event
})
.on('end', function() {
.on('finish', function() {
// complete
})
```
Expand Down
6 changes: 1 addition & 5 deletions docs/add.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ request(url) // <- could also be something like fs.getReadS
.pipe(JSONStream.parse())
.pipe(index.defaultPipeline())
.pipe(index.add())
.on('data', function(d) {
// this function needs to be called if you want to listen for the end event
})
.on('end', function() {
.on('finish', function() {
// complete
})
```
Expand Down Expand Up @@ -120,6 +117,5 @@ The `.add` is a writable stream that accepts the processed documents
dataStream // <- stream of docs to be indexed
.pipe(index.defaultPipeline())
.pipe(index.add())
// <- you must drain and end the stream here (see top of page)
```

0 comments on commit 3dd796b

Please sign in to comment.