summaryrefslogtreecommitdiff
path: root/db/jsobj.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-01-05 14:47:51 -0500
committerEliot Horowitz <eliot@10gen.com>2009-01-05 14:47:51 -0500
commit037e2ae555e741fbe12da7b63a8cbfb016fa834c (patch)
tree1bfa21a0bb8057e0ff390910fa8d0510c5a6e471 /db/jsobj.h
parent390fc85eb95a65f339d5cd7642750b088f3290f4 (diff)
downloadmongo-037e2ae555e741fbe12da7b63a8cbfb016fa834c.tar.gz
hasField
Diffstat (limited to 'db/jsobj.h')
-rw-r--r--db/jsobj.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/db/jsobj.h b/db/jsobj.h
index 8821bbbbc67..8df8141fe40 100644
--- a/db/jsobj.h
+++ b/db/jsobj.h
@@ -351,6 +351,10 @@ public:
};
BSONElement getField(const char *name) const; /* return has eoo() true if no match */
+ bool hasField( const char * name )const {
+ return ! getField( name ).eoo();
+ }
+
// returns "" if DNE or wrong type
const char * getStringField(const char *name);