assert Product.countHits("coffee") == 5
Purpose
Executes a MongoDB $text search query and returns the number of hits.
Examples
Description
The countHits
method uses MongoDB’s full text search support to perform full text search on a "text" index and return the size of the returned cursor.