diff options
Diffstat (limited to 'bson/bsonobj.h')
-rw-r--r-- | bson/bsonobj.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bson/bsonobj.h b/bson/bsonobj.h index 4600c171fe1..7c5a9516cc1 100644 --- a/bson/bsonobj.h +++ b/bson/bsonobj.h @@ -322,7 +322,14 @@ namespace mongo { /** add all elements of the object to the specified list */ void elems(list<BSONElement> &) const; - /** add all values of the object to the specified vector. If type mismatches, exception. */ + /** add all values of the object to the specified vector. If type mismatches, exception. + this is most useful when the BSONObj is an array, but can be used with non-arrays too in theory. + + example: + bo sub = y["subobj"].Obj(); + vector<int> myints; + sub.Vals(myints); + */ template <class T> void Vals(vector<T> &) const; /** add all values of the object to the specified list. If type mismatches, exception. */ |