# WithDataBindMount

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

Adds a bind mount for the data folder to a SurrealDB resource.

## Remarks

Add a SurrealDB container to the application model and reference it in a .NET project.
Additionally, in this example a bind mount is added to the container
to allow data to be persisted across container restarts.
```
var builder = DistributedApplication.CreateBuilder(args);
var db = builder.AddSurrealServer("surreal")
.WithDataBindMount("./data/surreal/data")
.AddNamespace("ns")
.AddDatabase("db");
var api = builder.AddProject<Projects.Api>("api")
.WithReference(db);
builder.Build().Run();
```

## Definition

```go
func (SurrealDbServerResource) WithDataBindMount(source string) SurrealDbServerResource
```

## Parameters

- `source` (`string`) -- The source directory on the host to mount into the container.

## Returns

[`SurrealDbServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md) -- The `IResourceBuilder`.

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

## Applies to

- [`SurrealDbServerResource`](/reference/api/go/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md)
