Add getTotalDocs() to help doing unit testing.