.Get the number of all documents in the cluster
[source,js]
---------
const { count } = await client.count();
---------

.Get the number of documents in an index
[source,js]
---------
const { count } = await client.count({
  index: 'index_name'
});
---------

.Get the number of documents matching a query
[source,js]
---------
const { count } = await client.count({
  index: 'index_name',
  body: {
    query: {
      filtered: {
        filter: {
          terms: {
            foo: ['bar']
          }
        }
      }
    }
  }
});
---------
