This is the ThingsDB documentation for version v0, click here for the latest version!

has_collection

Determines if a collection exists in ThingsDB.

This function does not generate an event.

Function

has_collection(collection)

Arguments

Argument Type Description
collection str/int (required) Collection name or Id to check.

Return value

Returns true if the collection exists and otherwise false.

Example

This code shows an example use case of has_collection():

has_collection('stuff');

Return value in JSON format

true