summaryrefslogtreecommitdiff
path: root/src/mongo/db/keypattern.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/keypattern.cpp')
-rw-r--r--src/mongo/db/keypattern.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/keypattern.cpp b/src/mongo/db/keypattern.cpp
index 89eca1f16c6..7379c69bd2e 100644
--- a/src/mongo/db/keypattern.cpp
+++ b/src/mongo/db/keypattern.cpp
@@ -40,6 +40,18 @@ namespace mongo {
}
}
+ string KeyPattern::findPluginName(const BSONObj& keyPattern) {
+ BSONObjIterator i(keyPattern);
+
+ while (i.more()) {
+ BSONElement e = i.next();
+ if (String != e.type()) { continue; }
+ return e.String();
+ }
+
+ return "";
+ }
+
BSONObj KeyPattern::extractSingleKey(const BSONObj& doc ) const {
if ( _pattern.isEmpty() )
return BSONObj();