.\" This manpage is Copyright (C) 2016 MongoDB, Inc. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.3 .\" or any later version published by the Free Software Foundation; .\" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. .\" A copy of the license is included in the section entitled "GNU .\" Free Documentation License". .\" .TH "MONGOC_DATABASE_COMMAND" "3" "2016\(hy10\(hy12" "MongoDB C Driver" .SH NAME mongoc_database_command() \- The mongoc_database_command() function shall execute a command on a database. This is performed lazily after calling mongoc_cursor_next() on the resulting cursor structure. .SH "SYNOPSIS" .nf .nf mongoc_cursor_t * mongoc_database_command (mongoc_database_t *database, mongoc_query_flags_t flags, uint32_t skip, uint32_t limit, uint32_t batch_size, const bson_t *command, const bson_t *fields, const mongoc_read_prefs_t *read_prefs); .fi .fi .SH "PARAMETERS" .TP .B database A .B mongoc_database_t . .LP .TP .B flags A .B mongoc_query_flags_t . .LP .TP .B skip The number of documents to skip on the server. .LP .TP .B limit The maximum number of documents to return from the cursor. .LP .TP .B batch_size Attempt to batch results from the server in groups of .B batch_size documents. .LP .TP .B command A .B bson_t containing the command. .LP .TP .B fields An optional .B bson_t containing the fields to return. .B NULL for all fields. .LP .TP .B read_prefs An optional .B mongoc_read_prefs_t . Otherwise, the command uses mode .B MONGOC_READ_PRIMARY . .LP The .B mongoc_database_command(3) function shall execute a command on a database. This is performed lazily after calling .B mongoc_cursor_next(3) on the resulting cursor structure. .SH "RETURNS" This command returns a .B mongoc_cursor_t that should be freed with .B mongoc_cursor_destroy(3) when no longer in use. .SH "SEE ALSO" .B mongoc_cursor_next(3) .B .SH COLOPHON This page is part of MongoDB C Driver. Please report any bugs at https://jira.mongodb.org/browse/CDRIVER.