diff options
author | Jason Rassi <rassi@10gen.com> | 2014-12-16 14:23:48 -0500 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2014-12-16 14:31:58 -0500 |
commit | 0aede468dc2ea475aa83bddd8be1e56a19ca6a3a (patch) | |
tree | 97e72eefddfc6f533635b38ff7b7994f6f683233 /src/mongo/db/commands.h | |
parent | 7917b37c07d67dfb0e4bc8336942526962dceef3 (diff) | |
download | mongo-0aede468dc2ea475aa83bddd8be1e56a19ca6a3a.tar.gz |
SERVER-16518 listCollections response changed to cursor object form
As a temporary compatibility measure, the legacy behavior is preserved
if the "cursor" option is not sent with the command. This
compatibility layer will be removed as part of work for the parent
ticket.
Diffstat (limited to 'src/mongo/db/commands.h')
-rw-r--r-- | src/mongo/db/commands.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index 21baf7b22bc..f36ba4fb9d9 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -283,6 +283,18 @@ namespace mutablebson { // not look like the result of a command. static Status getStatusFromCommandResult(const BSONObj& result); + /** + * Builds a cursor response object from the provided cursor identifiers and "firstBatch", + * and appends the response object to the provided builder under the field name "cursor". + * + * The response object has the following format: + * { id: <NumberLong>, ns: <String>, firstBatch: <Array> }. + */ + static void appendCursorResponseObject(long long cursorId, + StringData cursorNamespace, + BSONArray firstBatch, + BSONObjBuilder* builder); + // Set by command line. Controls whether or not testing-only commands should be available. static int testCommandsEnabled; |