Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/Array.h
Implements the BSON Array
Direct Base Classes: Document
All Base Classes: Document
Member Functions: get, isType, toString
Inherited Functions: add, addElement, addNewDocument, clear, elementNames, empty, exists, get, isType, read, size, toString, write
typedef SharedPtr < Array > Ptr;
Array();
Constructor
virtual ~Array();
Destructor
template < typename T > T get(
int pos
) const;
Returns the element on the given index and tries to convert it to the template type. When the element is not found, a NotFoundException will be thrown. When the element can't be converted a BadCastException will be thrown.
template < typename T > T get(
int pos,
const T & def
) const;
Returns the element on the given index and tries to convert it to the template type. When the element is not found, or has the wrong type, the def argument will be returned.
Element::Ptr get(
int pos
) const;
Returns the element on the given index. An empty element will be returned when the element is not found.
template < typename T > bool isType(
int pos
);
Returns true when the type of the element equals the TypeId of ElementTrait
std::string toString(
int indent = 0
) const;
See also: Poco::MongoDB::Document::toString()