has_collection

Determines if a collection exists in ThingsDB.

This function does not generate an event.

Function

has_collection(name_or_id)

Arguments

Argument Type Description
name_or_id 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