(Quick Reference)

Purpose

Executes a MongoDB $text search query and returns the number of hits.

Examples

assert Product.countHits("coffee") == 5

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.