Loading...
Searching...
No Matches
mongocxx::hint Class Reference

`#include <mongocxx/v_noabi/mongocxx/hint.hpp>`

## Description

The index to "hint" or force a MongoDB server to use when performing a query.

## Public Member Functions

| hint (bsoncxx::v_noabi::document::view_or_value index)
| Constructs a new hint.
| hint (bsoncxx::v_noabi::string::view_or_value index)
| Constructs a new hint.
| hint (v1::hint hint)
| Construct with the mongocxx::v1 equivalent.
| operator bsoncxx::v_noabi::types::view () const
| Returns a bsoncxx::v_noabi::types::view representing this hint.
| operator v1::hint () const
| Convert to the mongocxx::v1 equivalent.
bsoncxx::v_noabi::types::view | to_value () const
| Returns a bsoncxx::v_noabi::types::view representing this hint.

## Related Symbols

(Note that these are not member symbols.)
bool | operator== (hint const &index_hint, bsoncxx::v_noabi::document::view index)
| Convenience methods to compare for equality against an index document.
bool | operator== (hint const &index_hint, std::string index)
| Convenience methods to compare for equality against an index name.
bool | operator== (std::string str, hint const &hint)
| Convenience methods to compare against an index name.
bool | operator!= (hint const &hint, std::string str)
| Convenience methods to compare against an index name.
bool | operator!= (std::string str, hint const &hint)
| Convenience methods to compare against an index name.
bool | operator== (bsoncxx::v_noabi::document::view doc, hint const &hint)
| Convenience methods to compare for equality against an index document.
bool | operator!= (hint const &hint, bsoncxx::v_noabi::document::view doc)
| Convenience methods to compare for equality against an index document.
bool | operator!= (bsoncxx::v_noabi::document::view doc, hint const &hint)
| Convenience methods to compare for equality against an index document.

## Constructor & Destructor Documentation

## hint() [1/3]

mongocxx::v_noabi::hint::hint | ( | v1::hint | hint | ) |

Construct with the mongocxx::v1 equivalent.

## hint() [2/3]

mongocxx::v_noabi::hint::hint | ( | bsoncxx::v_noabi::document::view_or_value | index | ) |

inline

Constructs a new hint.

Note: this constructor is purposefully not explicit, to allow conversion from either document::view or document::value to view_or_value.

Parameters

  index | Document view or value representing the index to be used.

## hint() [3/3]

mongocxx::v_noabi::hint::hint | ( | bsoncxx::v_noabi::string::view_or_value | index | ) |

inline explicit

Constructs a new hint.

Parameters

  index | String representing the name of the index to be used.

## Member Function Documentation

## operator bsoncxx::v_noabi::types::view()

mongocxx::v_noabi::hint::operator bsoncxx::v_noabi::types::view | ( |  | ) | const

inline

Returns a bsoncxx::v_noabi::types::view representing this hint.

Returns
  Hint, as a bsoncxx::v_noabi::types::view. The caller must ensure that the returned object not outlive the hint object that it was created from.

## operator v1::hint()

mongocxx::v_noabi::hint::operator v1::hint | ( |  | ) | const

inline explicit

Convert to the mongocxx::v1 equivalent.

## to_value()

bsoncxx::v_noabi::types::view mongocxx::v_noabi::hint::to_value | ( |  | ) | const

inline

Returns a bsoncxx::v_noabi::types::view representing this hint.

Returns
  Hint, as a bsoncxx::v_noabi::types::view. The caller must ensure that the returned object not outlive the hint object that it was created from.

## Friends And Related Symbol Documentation

## operator!=() [1/4]

bool operator!= | ( | bsoncxx::v_noabi::document::view | doc,
|  | hint const & | hint )

related

Convenience methods to compare for equality against an index document.

Compares equal if the hint contains a matching index document. Otherwise, compares unequal.

## operator!=() [2/4]

bool operator!= | ( | hint const & | hint,
|  | bsoncxx::v_noabi::document::view | doc )

related

Convenience methods to compare for equality against an index document.

Compares equal if the hint contains a matching index document. Otherwise, compares unequal.

## operator!=() [3/4]

bool operator!= | ( | hint const & | hint,
|  | std::string | str )

related

Convenience methods to compare against an index name.

Compares equal if the hint contains a matching index name. Otherwise, compares unequal.

## operator!=() [4/4]

bool operator!= | ( | std::string | str,
|  | hint const & | hint )

related

Convenience methods to compare against an index name.

Compares equal if the hint contains a matching index name. Otherwise, compares unequal.

## operator==() [1/4]

bool operator== | ( | bsoncxx::v_noabi::document::view | doc,
|  | hint const & | hint )

related

Convenience methods to compare for equality against an index document.

Compares equal if the hint contains a matching index document. Otherwise, compares unequal.

## operator== [2/4]

bool operator== | ( | hint const & | index_hint,
|  | bsoncxx::v_noabi::document::view | index )

friend

Convenience methods to compare for equality against an index document.

Compares equal if the hint contains a matching index document. Otherwise, compares unequal.

## operator== [3/4]

bool operator== | ( | hint const & | index_hint,
|  | std::string | index )

friend

Convenience methods to compare for equality against an index name.

Compares equal if the hint contains a matching index name. Otherwise, compares unequal.

## operator==() [4/4]

bool operator== | ( | std::string | str,
|  | hint const & | hint )

related

Convenience methods to compare against an index name.

Compares equal if the hint contains a matching index name. Otherwise, compares unequal.

The documentation for this class was generated from the following file:

- mongocxx/v_noabi/mongocxx/hint.hpp