When leveraging MongoDB with a Default Indexing Policy enabled (such as Azure/CosmosDB) the configuration requires any sort() fields to have a corresponding index. Without indexes, all database calls (with the exception of default _id indexes) fail. These failures result in 500 errors for the prompts sidebar and a complete loss in prompt functionality.
This PR adds initialization for the database to create the indexes.
When leveraging MongoDB with a Default Indexing Policy enabled (such as Azure/CosmosDB) the configuration requires any
sort()
fields to have a corresponding index. Without indexes, all database calls (with the exception of default_id
indexes) fail. These failures result in 500 errors for the prompts sidebar and a complete loss in prompt functionality.This PR adds initialization for the database to create the indexes.