mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-01 20:01:35 +00:00
📇 fix: Index sharedlinks updatedAt for Cosmos DB Sorts (#13979)
The getSharedLink query sorts by updatedAt, but the sharedlinks collection had no updatedAt index. Azure Cosmos DB for MongoDB (RU-based) rejects sorts on non-indexed fields, causing an immediate 500 on GET /api/share/link/:conversationId whenever a conversation is opened. Standard MongoDB is unaffected.
This commit is contained in:
parent
edeb1ecc2c
commit
3790bdcff2
1 changed files with 1 additions and 0 deletions
|
|
@ -84,5 +84,6 @@ const shareSchema: Schema<ISharedLink> = new Schema(
|
|||
|
||||
shareSchema.index({ expiredAt: 1 }, { expireAfterSeconds: 0 });
|
||||
shareSchema.index({ conversationId: 1, user: 1, targetMessageId: 1, tenantId: 1 });
|
||||
shareSchema.index({ updatedAt: -1 });
|
||||
|
||||
export default shareSchema;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue