summaryrefslogtreecommitdiff
path: root/db/jsobj.h
diff options
context:
space:
mode:
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);