Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions api-reference/go/datasets/Collections.Delete.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Client.Collections.Delete
sidebarTitle: Collections.Delete
icon: layer-group
---

```go
func (collectionClient) Delete(
ctx context.Context,
datasetID uuid.UUID,
name string,
) error
```

Delete a collection by its name.

## Parameters

<ParamField path="datasetID" type="uuid.UUID">
The id of the dataset
</ParamField>
<ParamField path="name" type="string">
The name of the collection
</ParamField>

## Returns

An error if the collection could not be deleted.

<RequestExample>
```go Go
err := client.Collections.Delete(ctx,
datasetID,
"My-collection",
)
```
</RequestExample>

## Errors

<ParamField path="not_found" type="No such dataset">
The specified dataset does not exist.
</ParamField>
<ParamField path="not_found" type="No such collection">
The specified collection does not exist.
</ParamField>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Dataset.delete_collection
icon: database
---

```python
def Dataset.delete_collection(name: str) -> None
```

Delete a collection in the dataset.

## Parameters

<ParamField path="name" type="string">
The name of the collection
</ParamField>

<RequestExample>
```python Python
dataset.delete_collection("My-collection")
```
</RequestExample>
15 changes: 15 additions & 0 deletions datasets/concepts/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,21 @@ log.Println(collection.String())
L1GT: [2013-03-25T12:08:43.699 UTC, 2024-08-19T12:57:32.456 UTC] (154288 data points)
```

## Deleting collections

Collections can be deleted from a dataset using the `delete_collection` method.

To delete a collection, you need to have write permission on the dataset.

<CodeGroup>
```python Python
dataset.delete_collection("My-collection")
```
```go Go
err := client.Collections.Delete(ctx, dataset.ID, "My-collection")
```
</CodeGroup>

## Errors you may encounter

### NotFoundError
Expand Down
2 changes: 2 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"api-reference/python/tilebox.datasets/Dataset.collections",
"api-reference/python/tilebox.datasets/Dataset.collection",
"api-reference/python/tilebox.datasets/Dataset.create_collection",
"api-reference/python/tilebox.datasets/Dataset.delete_collection",
"api-reference/python/tilebox.datasets/Dataset.get_or_create_collection",
"api-reference/python/tilebox.datasets/Collection.delete",
"api-reference/python/tilebox.datasets/Collection.find",
Expand Down Expand Up @@ -200,6 +201,7 @@
"api-reference/go/datasets/Collections.Create",
"api-reference/go/datasets/Collections.Get",
"api-reference/go/datasets/Collections.GetOrCreate",
"api-reference/go/datasets/Collections.Delete",
"api-reference/go/datasets/Collections.List",
"api-reference/go/datasets/Datapoints.GetInto",
"api-reference/go/datasets/Datapoints.Query",
Expand Down