From 450dc96f2e57bea4af7929d2ad10d3afb774e410 Mon Sep 17 00:00:00 2001 From: Jason Rassi Date: Fri, 28 Aug 2015 02:17:49 -0400 Subject: SERVER-19569 CursorResponse::toBSON() ability to return first batch --- src/mongo/db/query/cursor_response.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/query/cursor_response.h') diff --git a/src/mongo/db/query/cursor_response.h b/src/mongo/db/query/cursor_response.h index e606dcd1559..ac15477e28c 100644 --- a/src/mongo/db/query/cursor_response.h +++ b/src/mongo/db/query/cursor_response.h @@ -66,6 +66,11 @@ void appendGetMoreResponseObject(long long cursorId, BSONObjBuilder* builder); struct CursorResponse { + enum class ResponseType { + InitialResponse, + SubsequentResponse, + }; + /** * Constructs from values for each of the fields. */ @@ -82,8 +87,8 @@ struct CursorResponse { /** * Converts this response to its raw BSON representation. */ - BSONObj toBSON() const; - void addToBSON(BSONObjBuilder* builder) const; + BSONObj toBSON(ResponseType responseType) const; + void addToBSON(ResponseType responseType, BSONObjBuilder* builder) const; const NamespaceString nss; const CursorId cursorId; -- cgit v1.2.1