# RavenDBServerResource

- Module: [CommunityToolkit.Aspire.Hosting.RavenDB](/reference/api/typescript/communitytoolkit.aspire.hosting.ravendb.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

A resource that represents a RavenDB container.

## Definition

```typescript
interface RavenDBServerResource
  extends IComputeResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly databases: Dict<string,string>;
  readonly host: EndpointReferenceExpression;
  readonly port: EndpointReferenceExpression;
  readonly primaryEndpoint: EndpointReference;
  readonly tcpEndpoint: EndpointReference;
  readonly uriExpression: ReferenceExpression;
  addDatabase(
      name: string,
      databaseName?: string,
      ensureCreated?: boolean): RavenDBDatabaseResource;
  withDataBindMount(
      source: string,
      isReadOnly?: boolean): RavenDBServerResource;
  withDataVolume(
      name?: string,
      isReadOnly?: boolean): RavenDBServerResource;
  withLogBindMount(
      source: string,
      isReadOnly?: boolean): RavenDBServerResource;
  withLogVolume(
      name?: string,
      isReadOnly?: boolean): RavenDBServerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the connection string expression for the RavenDB server, formatted as "http(s)://{Host}:{Port}" depending on the security setting.
- `databases`: `Dict<string,string>` `get` -- Gets a read-only dictionary of databases associated with this server resource. The key represents the resource name, and the value represents the database name.
- `host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `primaryEndpoint`: `EndpointReference` `get` -- Gets the primary endpoint for the RavenDB server.
- `tcpEndpoint`: `EndpointReference` `get` -- Gets the TCP endpoint for the RavenDB server.
- `uriExpression`: `ReferenceExpression` `get` -- Gets the connection URI expression for the RavenDB server.

## Methods

- [addDatabase](/reference/api/typescript/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource/adddatabase.md) -- `method` -- Adds a database resource to an existing RavenDB server resource.
    ```typescript
  addDatabase(name: string, databaseName?: string, ensureCreated?: boolean): RavenDBDatabaseResource
  ```
- [withDataBindMount](/reference/api/typescript/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource/withdatabindmount.md) -- `method` -- Adds a bind mount for the data folder to a RavenDB container resource.
    ```typescript
  withDataBindMount(source: string, isReadOnly?: boolean): RavenDBServerResource
  ```
- [withDataVolume](/reference/api/typescript/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource/withdatavolume.md) -- `method` -- Adds a named volume for the data folder to a RavenDB container resource.
    ```typescript
  withDataVolume(name?: string, isReadOnly?: boolean): RavenDBServerResource
  ```
- [withLogBindMount](/reference/api/typescript/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource/withlogbindmount.md) -- `method` -- Adds a bind mount for the logs folder to a RavenDB container resource.
    ```typescript
  withLogBindMount(source: string, isReadOnly?: boolean): RavenDBServerResource
  ```
- [withLogVolume](/reference/api/typescript/communitytoolkit.aspire.hosting.ravendb/ravendbserverresource/withlogvolume.md) -- `method` -- Adds a named volume for the logs folder to a RavenDB container resource.
    ```typescript
  withLogVolume(name?: string, isReadOnly?: boolean): RavenDBServerResource
  ```
