summaryrefslogtreecommitdiff
path: root/bson
diff options
context:
space:
mode:
authorDwight <dwight@10gen.com>2010-11-02 11:53:37 -0400
committerDwight <dwight@10gen.com>2010-11-02 11:53:37 -0400
commit89197e9518f82bc422e67b17c44aebb1467917cf (patch)
tree0e5b30cfa05c2f9d3b16440d03ac6d515290a5a1 /bson
parent53973d365f4276c918d10c1337fc492201fd305d (diff)
downloadmongo-89197e9518f82bc422e67b17c44aebb1467917cf.tar.gz
comment
Diffstat (limited to 'bson')
-rw-r--r--bson/bsonobj.h9
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. */