diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-07-17 22:42:31 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-07-20 16:03:29 -0400 |
commit | 610765fdb94eebf612bd0172ec081ccc21110103 (patch) | |
tree | d93bf7404b151c3e681eb1eda9e37ba4a3cb6ae7 /src/mongo/db/pipeline/document.h | |
parent | 4f1dda92ed5976ab950e2eaaaffd7bd20296a066 (diff) | |
download | mongo-610765fdb94eebf612bd0172ec081ccc21110103.tar.gz |
SERVER-533 Add aggregation stage to randomly sample documents
Diffstat (limited to 'src/mongo/db/pipeline/document.h')
-rw-r--r-- | src/mongo/db/pipeline/document.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document.h b/src/mongo/db/pipeline/document.h index 5010f69b5fa..c6a100c954b 100644 --- a/src/mongo/db/pipeline/document.h +++ b/src/mongo/db/pipeline/document.h @@ -201,6 +201,14 @@ public: return storage().getTextScore(); } + static const StringData metaFieldRandVal; // "$randVal" + bool hasRandMetaField() const { + return storage().hasRandMetaField(); + } + int64_t getRandMetaField() const { + return storage().getRandMetaField(); + } + /// members for Sorter struct SorterDeserializeSettings {}; // unused void serializeForSorter(BufBuilder& buf) const; @@ -421,6 +429,10 @@ public: storage().setTextScore(score); } + void setRandMetaField(int64_t val) { + storage().setRandMetaField(val); + } + /** Convert to a read-only document and release reference. * * Call this to indicate that you are done with this Document and will |