Skip to main content
Version: V1.1.0

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)
ParameterTypeRequiredDescriptionExample value
namestringYesThe 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

ParameterTypeRequiredDescriptionExample value
(return value)boolYesTrue if the collection exists; False otherwise.True

Response example

True