1.3 KiB
////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock collectionByExampleHash
/// @brief constructs a query-by-example using a hash index
/// collection.byExampleHash(index, example)
///
/// Selects all documents from the specified hash index that match the
/// specified example and returns a cursor.
///
/// You can use toArray, next, or hasNext to access the
/// result. The result can be limited using the skip and limit
/// operator.
///
/// An attribute name of the form a.b is interpreted as attribute path,
/// not as attribute. If you use
///
/// { a : { c : 1 } }
///
/// as example, then you will find all documents, such that the attribute
/// a contains a document of the form {c : 1 }. For example the document
///
/// { a : { c : 1 }, b : 1 }
///
/// will match, but the document
///
/// { a : { c : 1, b : 1 } }
///
/// will not.
///
/// However, if you use
///
/// { a.c : 1 },
///
/// then you will find all documents, which contain a sub-document in a
/// that has an attribute @LIT{c} of value 1. Both the following documents
///
/// { a : { c : 1 }, b : 1 } and
///
/// { a : { c : 1, b : 1 } }
///
/// will match.
///
/// collection.byExampleHash(index-id, path1, value1, ...)
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////