MongoDB C++ Driver  mongocxx-3.0.2
Public Member Functions | Related Functions | List of all members
mongocxx::hint Class Reference

Class representing a hint to be passed to a database operation. More...

#include <hint.hpp>

Public Member Functions

 hint (bsoncxx::document::view_or_value index)
 Constructs a new hint. More...
 
 hint (bsoncxx::string::view_or_value index)
 Constructs a new hint. More...
 
bsoncxx::document::value to_document () const
 Return a bson document representing this hint. More...
 
 operator bsoncxx::document::value () const
 

Related Functions

(Note that these are not member functions.)

bool operator== (std::string index, const hint &index_hint)
 Convenience methods to compare for equality against an index name. More...
 
bool operator== (bsoncxx::document::view index, const hint &index_hint)
 Convenience methods to compare for equality against an index document. More...
 
bool operator!= (const hint &index_hint, std::string index)
 Convenience methods to compare for inequality against an index name. More...
 
bool operator!= (const hint &index_hint, bsoncxx::document::view index)
 Convenience methods to compare for equality against an index document. More...
 
bool operator== (const hint &index_hint, std::string index)
 Compare this hint to a string for (in)-equality.
 
bool operator== (const hint &index_hint, bsoncxx::document::view index)
 Compare this hint to a string for (in)-equality.
 

Detailed Description

Class representing a hint to be passed to a database operation.

Constructor & Destructor Documentation

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

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
indexDocument view or value representing the index to be used.
mongocxx::hint::hint ( bsoncxx::string::view_or_value  index)
explicit

Constructs a new hint.

Parameters
indexString representing the name of the index to be used.

Member Function Documentation

mongocxx::hint::operator bsoncxx::document::value ( ) const
Todo:
document this method
bsoncxx::document::value mongocxx::hint::to_document ( ) const

Return a bson document representing this hint.

Returns
Hint, as a document.

Friends And Related Function Documentation

bool operator!= ( const hint index_hint,
std::string  index 
)
related

Convenience methods to compare for inequality against an index name.

Return true if this hint contains an index name that matches.

bool operator!= ( const hint index_hint,
bsoncxx::document::view  index 
)
related

Convenience methods to compare for equality against an index document.

Return true if this hint contains an index document that matches.

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

Convenience methods to compare for equality against an index name.

Return true if this hint contains an index name that matches.

bool operator== ( bsoncxx::document::view  index,
const hint index_hint 
)
related

Convenience methods to compare for equality against an index document.

Return true if this hint contains an index document that matches.


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