has_collection - Check if a collection exists
has_collection() checks whether a collection with the given name exists.
info
This API is only available when you are connected using a client. For more information, see Client.
Prerequisites
-
You have installed pyseekdb. For installation details, see Quick Start.
-
You are connected to the database. For connection details, see Client.
Request parameters
client.has_collection(name)
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
name | string | Yes | The name of the collection to check. | my_collection |
Request example
import pyseekdb
# Create a client
client = pyseekdb.Client()
# Check if a collection exists
collection_exists = client.has_collection("my_collection")
print(collection_exists)
Response parameters
| Parameter | Type | Required | Description | Example value |
|---|---|---|---|---|
| (return value) | bool | Yes | True if the collection exists; False otherwise. | True |
Response example
True