# WithDataVolume

- Module: [CommunityToolkit.Aspire.Hosting.RavenDB](/reference/api/go/communitytoolkit.aspire.hosting.ravendb.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`RavenDBServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Adds a named volume for the data folder to a RavenDB container resource.

## Definition

```go
func (RavenDBServerResource) WithDataVolume(options ...*WithDataVolumeOptions) RavenDBServerResource
```

## Parameters

- `options` (`...*WithDataVolumeOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithDataVolumeOptions` argument.

- `Name` (`*string`) -- Optional name for the volume. Defaults to a generated name if not provided.
- `IsReadOnly` (`*bool`) -- Indicates whether the volume should be read-only. Defaults to false.

## Returns

[`RavenDBServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource.md) -- The `IResourceBuilder` for the RavenDB server resource.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`RavenDBServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource.md)
