Skip to main content
Version: V1.4.0

Collection management

In seekdb-js, a collection is a set of data, similar to a table in a database. You can create, query, and delete collections.

The following APIs are available for managing collections.

APIDescriptionRelated document link
createCollection()Creates a collection.Documentation
getCollection()Retrieves a specified collection.Documentation
getOrCreateCollection()Creates or retrieves a collection. If the collection does not exist in the database, it is created; if it exists, the corresponding result is retrieved.Documentation
fork()Copies a specified collection to create a new collection with the same data.Documentation
listCollections()Retrieves a list of collections in the database.Documentation
countCollection()Counts the number of collections in the database.Documentation
hasCollection()Checks whether a specified collection exists in the database.Documentation
deleteCollection()Deletes a specified collection.Documentation

Methods on the Collection object​

Call the following APIs on a Collection instance after you obtain it through createCollection(), getCollection(), or similar methods (for example, await collection.refresh_index()).

APIDescriptionDocumentation
refresh_index()Advances asynchronous vector index visibility so writes can participate in approximate search sooner.Documentation