diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b19fb95..19b909d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Arrange environment variables and data deletion endpoint into single row in capability. [#989](https://github.com/rokwire/rokwire-building-blocks-api/issues/989) - API Doc Dockerfile URLs to include new building blocks and remove unsupported building blocks. [#831](https://github.com/rokwire/rokwire-building-blocks-api/issues/831) - Talent fields yaml configuration [#949](https://github.com/rokwire/rokwire-building-blocks-api/issues/949) +- Drop old indexes in contributions collection in mongodb. [#1029](https://github.com/rokwire/rokwire-building-blocks-api/issues/1029) ### Fixed - Fix Core BB service token support in events [#994](https://github.com/rokwire/rokwire-building-blocks-api/issues/994) diff --git a/contributions/api/utils/mongoutils.py b/contributions/api/utils/mongoutils.py index 4dde3c2a..2d8f3dc8 100644 --- a/contributions/api/utils/mongoutils.py +++ b/contributions/api/utils/mongoutils.py @@ -30,8 +30,8 @@ coll_contribution = db_contribution[cfg.CONTRIBUTION_COLL_NAME] # set contribution collection # drop old indexes in contribution collection coll_contribution_indexes = coll_contribution.index_information().keys() -# get all indexes except id and text index -coll_contribution_old_indexes = [index for index in coll_contribution_indexes if index not in ['_id_', 'text_index']] +# get old indexes +coll_contribution_old_indexes = [index for index in coll_contribution_indexes if index in ['name', 'capabilities.name', 'talents.name']] for index_name in coll_contribution_old_indexes: coll_contribution.drop_index(index_name) # create compound text indexes with equal weightage