MongoCursor::hint

(PECL mongo >=0.9.0)

MongoCursor::hintGives the database a hint about the query

说锟斤拷

public MongoCursor::hint ( mixed $index ) : MongoCursor

锟斤拷锟斤拷

index

Index to use for the query. If a string is passed, it should correspond to an index name. If an array or object is passed, it should correspond to the specification used to create the index (i.e. the first argument to MongoCollection::ensureIndex()).

锟斤拷锟斤拷值

Returns this cursor.

锟斤拷锟斤拷锟届常

Throws MongoCursorException if this cursor has started iterating.

锟斤拷锟斤拷锟斤拷志

锟芥本 说锟斤拷
1.4.0

The index argument now supports index names as string values. In versions before 1.4.0, only array or object values were accepted.