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 15:40:54 -0400 |
commit | 824776f67165d4ee0447c1e855dcd8a79643b73c (patch) | |
tree | e7f1968d0a75d3b0f3e8c2af6c0c02af138fecae /src/mongo/db/pipeline/document.h | |
parent | 75a73c76f2304e89ab9f7e611f9ba82a07de520e (diff) | |
download | mongo-824776f67165d4ee0447c1e855dcd8a79643b73c.tar.gz |
$sample
Conflicts:
src/mongo/db/pipeline/document_source.h
src/mongo/db/pipeline/document_source_test.cpp
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 |