---
name: "mongoc_gridfs_bucket_find"
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_gridfs_bucket_find"
---

# mongoc\_gridfs\_bucket\_find(3)

## SYNOPSIS

```
mongoc_cursor_t *
mongoc_gridfs_bucket_find (mongoc_gridfs_bucket_t *bucket,
                           const bson_t *filter,
                           const bson_t *opts);
```

## PARAMETERS

- •

  **bucket**: A *mongoc\_gridfs\_bucket\_t*.

- •

  **filter**: A *bson\_t* containing the query to execute.

- •

  **opts**: A *bson\_t* for query options, supporting all options in *mongoc\_collection\_find\_with\_opts()* excluding **sessionId**.

## DESCRIPTION

Finds file documents from the bucket's **files** collection.

This function is considered a retryable read operation. Upon a transient error (a network error, errors due to replica set failover, etc.) the operation is safely retried once. If **retryreads** is false in the URI (see *mongoc\_uri\_t*) the retry behavior does not apply.

## RETURNS

A newly allocated *mongoc\_cursor\_t* that must be freed with *mongoc\_cursor\_destroy()*.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
