Healy-Hyperspatial / stac-fastapi-mongo

Mongodb backend for stac-fastapi built on the stac-fastapi-elasticsearch core api library.
MIT License
6 stars 1 forks source link

Are Item IDs required to be unique across multiple collections? #25

Closed pedro-cf closed 3 months ago

pedro-cf commented 3 months ago

Greetings, are Item IDs required to be unique across multiple collections?

Currently this is enforced based on this index: https://github.com/Healy-Hyperspatial/stac-fastapi-mongo/blob/e06e1769e80b438c34cc52910baab95f5e828726/stac_fastapi/mongo/database_logic.py#L78

Can you confirm @jonhealy1 ?

If not I would like to change this line to:

await collection.create_index([("collection", 1), ("id", 1)], unique=True)

Not sure if this is the also the case for https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch

jonhealy1 commented 3 months ago

Hi. I don't think item ids should be unique across collections.

jonhealy1 commented 3 months ago

Here in sfeos, the id is being created from both the item id and the collection id.

pedro-cf commented 3 months ago

Here in sfeos, the id is being created from both the item id and the collection id.

awesome so it's not an issue for sfeos, thank you