lib/sync.js
function (next) {
            self.count().exec(function (err, count) {
                if (err) {
                    return next(err)
                }

                docsToIndex = count

                return next()
            })
        }
function (next) {
            self.count().exec(function (err, count) {
                if (err) {
                    return next(err)
                }

                docsToIndex = count

                return next()
            })
        }
function ( next ) { self . count ( ) . exec ( function ( err , count ) { if ( err ) { return next ( err ) } docsToIndex = count return next ( ) } ) }
get a count of how many documents we have to index
get a count of how many documents we have to index