Skip to content

Commit 09d598f

Browse files
committed
create collection
1 parent cb68b06 commit 09d598f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,18 @@ async def delete_item(
568568
)
569569

570570
async def create_collection(self, collection: Collection, refresh: bool = False):
571-
"""Database logic for creating one collection."""
571+
"""Create a single collection in the database.
572+
573+
Args:
574+
collection (Collection): The Collection object to be created.
575+
refresh (bool, optional): Whether to refresh the index after the creation. Default is False.
576+
577+
Raises:
578+
ConflictError: If a Collection with the same id already exists in the database.
579+
580+
Notes:
581+
A new index is created for the items in the Collection using the `create_item_index` function.
582+
"""
572583
collection_id = collection["id"]
573584

574585
if await self.client.exists(index=COLLECTIONS_INDEX, id=collection_id):

0 commit comments

Comments
 (0)