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

"read-only" DB mode, and optional index creation #28

Closed GorgiAstro closed 2 weeks ago

GorgiAstro commented 4 weeks ago

Hi,

First of all thanks for the awesome mongo backend.

Is it possible to have a mode where the MongoDB is not written? For safety reasons I am using stac_fastapi_mongo with a read-only MongoDB user. The only issue I have is the calls create_collection_index() and create_item_index() which I had to comment out, otherwise it causes an error because of my read-only MongoDB user. I don't need to create these MongoDB indexes because my software which feeds data into the MongoDB already takes care of it, so it would be nice to make this optional.

jonhealy1 commented 4 weeks ago

Hi. Nice to hear from you. Would you be able to create a pr for this issue?

GorgiAstro commented 4 weeks ago

Yes I can. Is it okay to enable/disable the two calls create_collection_index() and create_item_index() using an environment variable (with the default value being the current behaviour, i.e. performing these two calls)?

jonhealy1 commented 4 weeks ago

Hi @GorgiAstro sounds good! Thank you

GorgiAstro commented 3 weeks ago

I opened a PR: https://github.com/Healy-Hyperspatial/stac-fastapi-mongo/pull/31

GorgiAstro commented 2 weeks ago

Closed by #31