diff options
Diffstat (limited to 'src/mongo/bson/bsonobj.h')
-rw-r--r-- | src/mongo/bson/bsonobj.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mongo/bson/bsonobj.h b/src/mongo/bson/bsonobj.h index 08992f5950d..bcfa2b0c5d4 100644 --- a/src/mongo/bson/bsonobj.h +++ b/src/mongo/bson/bsonobj.h @@ -203,7 +203,7 @@ namespace mongo { /** remove specified field and return a new object with the remaining fields. slowish as builds a full new object */ - BSONObj removeField(const StringData& name) const; + BSONObj removeField(StringData name) const; /** returns # of top level fields in the object note: iterates to count the fields @@ -217,14 +217,14 @@ namespace mongo { @param name field to find. supports dot (".") notation to reach into embedded objects. for example "x.y" means "in the nested object in field x, retrieve field y" */ - BSONElement getFieldDotted(const StringData &name) const; + BSONElement getFieldDotted(StringData name) const; /** Like getFieldDotted(), but expands arrays and returns all matching objects. * Turning off expandLastArray allows you to retrieve nested array objects instead of * their contents. */ - void getFieldsDotted(const StringData& name, BSONElementSet &ret, bool expandLastArray = true ) const; - void getFieldsDotted(const StringData& name, BSONElementMSet &ret, bool expandLastArray = true ) const; + void getFieldsDotted(StringData name, BSONElementSet &ret, bool expandLastArray = true ) const; + void getFieldsDotted(StringData name, BSONElementMSet &ret, bool expandLastArray = true ) const; /** Like getFieldDotted(), but returns first array encountered while traversing the dotted fields of name. The name variable is updated to represent field @@ -234,7 +234,7 @@ namespace mongo { /** Get the field of the specified name. eoo() is true on the returned element if not found. */ - BSONElement getField(const StringData& name) const; + BSONElement getField(StringData name) const; /** Get several fields at once. This is faster than separate getField() calls as the size of elements iterated can then be calculated only once each. @@ -247,7 +247,7 @@ namespace mongo { /** Get the field of the specified name. eoo() is true on the returned element if not found. */ - BSONElement operator[] (const StringData& field) const { + BSONElement operator[] (StringData field) const { return getField(field); } @@ -259,23 +259,23 @@ namespace mongo { } /** @return true if field exists */ - bool hasField( const StringData& name ) const { return !getField(name).eoo(); } + bool hasField( StringData name ) const { return !getField(name).eoo(); } /** @return true if field exists */ - bool hasElement(const StringData& name) const { return hasField(name); } + bool hasElement(StringData name) const { return hasField(name); } /** @return "" if DNE or wrong type */ - const char * getStringField(const StringData& name) const; + const char * getStringField(StringData name) const; /** @return subobject of the given name */ - BSONObj getObjectField(const StringData& name) const; + BSONObj getObjectField(StringData name) const; /** @return INT_MIN if not present - does some type conversions */ - int getIntField(const StringData& name) const; + int getIntField(StringData name) const; /** @return false if not present @see BSONElement::trueValue() */ - bool getBoolField(const StringData& name) const; + bool getBoolField(StringData name) const; /** @param pattern a BSON obj indicating a set of (un-dotted) field * names. Element values are ignored. @@ -300,7 +300,7 @@ namespace mongo { BSONObj filterFieldsUndotted(const BSONObj &filter, bool inFilter) const; - BSONElement getFieldUsingIndexNames(const StringData& fieldName, + BSONElement getFieldUsingIndexNames(StringData fieldName, const BSONObj &indexKey) const; /** arrays are bson objects with numeric and increasing field names |