---
name: "mongoc_query_flags_t"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_query_flags_t"
---

# mongoc\_query\_flags\_t(3)

Flags for query operations

## SYNOPSIS

```
typedef enum {
   MONGOC_QUERY_NONE = 0,
   MONGOC_QUERY_TAILABLE_CURSOR = 1 << 1,
   MONGOC_QUERY_SECONDARY_OK = 1 << 2,
   MONGOC_QUERY_OPLOG_REPLAY = 1 << 3,
   MONGOC_QUERY_NO_CURSOR_TIMEOUT = 1 << 4,
   MONGOC_QUERY_AWAIT_DATA = 1 << 5,
   MONGOC_QUERY_EXHAUST = 1 << 6,
   MONGOC_QUERY_PARTIAL = 1 << 7,
} mongoc_query_flags_t;
```

## DESCRIPTION

These flags correspond to the MongoDB wire protocol. They may be bitwise or'd together. They may modify how a query is performed in the MongoDB server.

## FLAG VALUES

| | |
| --- | --- |
| MONGOC\_QUERY\_NONE | Specify no query flags. |
| MONGOC\_QUERY\_TAILABLE\_CURSOR | Cursor will not be closed when the last data is retrieved. You can resume this cursor later. |
| MONGOC\_QUERY\_SECONDARY\_OK | Allow query of replica set secondaries. |
| MONGOC\_QUERY\_OPLOG\_REPLAY | Used internally by MongoDB. |
| MONGOC\_QUERY\_NO\_CURSOR\_TIMEOUT | The server normally times out an idle cursor after an inactivity period (10 minutes). This prevents that. |
| MONGOC\_QUERY\_AWAIT\_DATA | Use with MONGOC\_QUERY\_TAILABLE\_CURSOR. Block rather than returning no data. After a period, time out. |
| MONGOC\_QUERY\_EXHAUST | Stream the data down full blast in multiple "reply" packets. Faster when you are pulling down a lot of data and you know you want to retrieve it all. Only applies to cursors created from a find operation (i.e. *mongoc\_collection\_find()*). |
| MONGOC\_QUERY\_PARTIAL | Get partial results from mongos if some shards are down (instead of throwing an error). |

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
