summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands.h
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2014-12-16 14:23:48 -0500
committerJason Rassi <rassi@10gen.com>2014-12-16 14:31:58 -0500
commit0aede468dc2ea475aa83bddd8be1e56a19ca6a3a (patch)
tree97e72eefddfc6f533635b38ff7b7994f6f683233 /src/mongo/db/commands.h
parent7917b37c07d67dfb0e4bc8336942526962dceef3 (diff)
downloadmongo-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.h12
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;