---
title: getDatabaseWithDatabaseScope
framework: CloudKit JS
role: symbol
role_heading: Instance Method
platforms: [cloudkit js 1.0+]
path: cloudkitjs/cloudkit.container/getdatabasewithdatabasescope
---

# getDatabaseWithDatabaseScope

Returns the specified (public, private, or shared) database.

## Declaration

```data
CloudKit.Database getDatabaseWithDatabaseScope(
	CloudKit.DatabaseScope databaseScope
);
```

## Parameters

- `databaseScope`: Specifies the type of database to return.

## Return Value

Return Value The specified database.

## Discussion

Discussion This is a convenience method that you can use instead of the specific properties.

## See Also

### Getting the Public and Private Databases

- [publicCloudDatabase](cloudkitjs/cloudkit.container/publicclouddatabase.md)
- [privateCloudDatabase](cloudkitjs/cloudkit.container/privateclouddatabase.md)
- [sharedCloudDatabase](cloudkitjs/cloudkit.container/sharedclouddatabase.md)
