---
name: "mongoc_gridfs_file_set_id"
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_file_set_id"
---

# mongoc\_gridfs\_file\_set\_id(3)

## SYNOPSIS

```
bool
mongoc_gridfs_file_set_id (mongoc_gridfs_file_t *file,
                           const bson_value_t *id,
                           bson_error_t error);
```

## PARAMETERS

- •

  **file**: A :symbol:\` mongoc\_gridfs\_file\_t \<mongoc\_gridfs\_file\_t\>\`.

- •

  **id**: A *bson\_value\_t*.

- •

  **error**: A *bson\_error\_t*.

## DESCRIPTION

Sets the id of **file** to any BSON type.

If an error occurred, false is returned.

## RETURNS

Returns true on success. If any arguments are invalid, returns false and logs an error.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
