cursor.hint()

cursor.hint(index)
Arguments:
  • index – The specification for the index to “hint” or force MongoDB to use when performing the query.

Call this method on a query to override MongoDB’s default index selection and query optimization process. The argument is an index specification, like the argument to ensureIndex(). Use db.collection.getIndexes() to return the list of current indexes on a collection.

也可以参考

“$hint“

MongoDB Manual (Index)

关于

生态系统

格式

资源