diff options
author | Mathias Stearn <mathias@10gen.com> | 2009-12-09 13:19:18 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2009-12-09 13:19:18 -0500 |
commit | 4987213af9d1de0b948411e0d8ce4c16d4e59ba8 (patch) | |
tree | 46e0752defafbb87a245580580f9c95880980112 /db/jsobj.h | |
parent | dcf3a10eeaef2ea22678c9ae9aaa1fa2e9a81fa2 (diff) | |
download | mongo-4987213af9d1de0b948411e0d8ce4c16d4e59ba8.tar.gz |
More sane version of extractFieldsDotted (not used anywhere yet)
Diffstat (limited to 'db/jsobj.h')
-rw-r--r-- | db/jsobj.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/db/jsobj.h b/db/jsobj.h index 55a06da43c6..5015ce12c9c 100644 --- a/db/jsobj.h +++ b/db/jsobj.h @@ -828,16 +828,14 @@ namespace mongo { /** makes a new BSONObj with the fields specified in pattern. fields returned in the order they appear in pattern. - if any field is missing from the object, that field in the - key will be null. + if any field is missing or undefined in the object, that field in the + output will be null. - sets element field names to empty string + sets output field names to match pattern field names. If an array is encountered while scanning the dotted names in pattern, - that array is added to the returned obj, rather than any subobjects - referenced within the array. The variable nameWithinArray is set to the - name of the requested field within the returned array. + that field is treated as missing. */ - BSONObj extractFieldsDotted(BSONObj pattern, BSONObjBuilder& b, const char *&nameWithinArray) const; // this version, builder owns the returned obj buffer + BSONObj extractFieldsDotted(BSONObj pattern) const; /** sets element field names to empty string |