- MongoDB C Driver 1.13.1 »
- API Reference »
- mongoc_gridfs_file_t

# mongoc_gridfs_file_set_id()

## 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.

Created using Sphinx 1.8.3, based on Sphinx Readable Theme.