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.
| API | Description | Related 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 |