Skip to content

Commit

Permalink
adding documentation for count method to address #57
Browse files Browse the repository at this point in the history
  • Loading branch information
brozeph committed Jan 22, 2016
1 parent 6dc7eb5 commit 4483e6a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
@@ -1,3 +1,7 @@
# v0.5.1 / 2016-01-22

* Updated documentation for `count` method

# v0.5.0 / 2016-01-22

* Added support for promises while maintaining backwards compatibility in existing API (persuant to issue #58)
Expand Down
15 changes: 14 additions & 1 deletion README.md
Expand Up @@ -286,7 +286,7 @@ es.bulkIndex(options, documents, function (err, data) {

##### Count

`es.count(options, callback)`
`es.count(options, query, callback)`

```Javascript
var
Expand All @@ -306,6 +306,19 @@ var options = {
es.count(options, function (err, data) {
// counted... like a bawss
});

// count docs for a specific query
var query = {
query : {
term : {
breed : 'manx'
}
}
};

es.count(options, query, function (err, data) {
// teh count of teh manx kittehs
});
```

##### Delete
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"name": "es",
"description": "API around the ElasticSearch RESTful API -- mostly convenience.",
"main": "index.js",
"version": "0.5.0",
"version": "0.5.1",
"author": "Nick Campbell (http://github.com/ncb000gt)",
"contributors": [
"Nick Campbell (http://github.com/ncb000gt)",
Expand Down

0 comments on commit 4483e6a

Please sign in to comment.