From 9cbce133c6dd9913263e89c78b573dbe7612b60f Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Wed, 3 Jan 2024 08:58:07 +0000 Subject: [PATCH] Updating doc strings. --- .../elasticsearch/stac_fastapi/elasticsearch/core.py | 7 +++++-- .../stac_fastapi/elasticsearch/database_logic.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py index 64ad6cf1..a4f5cc1f 100644 --- a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py +++ b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py @@ -660,8 +660,11 @@ async def update_collection( Update a collection. This method updates an existing collection in the database by first finding - the collection by its id, then deleting the old version, and finally creating - a new version of the updated collection. The updated collection is then returned. + the collection by the id given in the keyword argument `collection_id`. + If no `collection_id` is given the id of the given collection object is used. + If the object and keyword collection ids don't match the sub items + collection id is updated else the items are left unchanged. + The updated collection is then returned. Args: collection: A STAC collection that needs to be updated. diff --git a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py index 35430e7d..9ed4b84a 100644 --- a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py +++ b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py @@ -771,7 +771,7 @@ async def update_collection( Args: self: The instance of the object calling this function. collection_id (str): The ID of the collection to be updated. - collection (Collection): The Collection object to be updated. + collection (Collection): The Collection object to be used for the update. Raises: NotFoundError: If the collection with the given `collection_id` is not