Skip to content

Commit

Permalink
better index
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego committed Oct 28, 2024
1 parent f0a1ae1 commit 295b94b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/meteor/server/models/raw/LivechatRooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ export class LivechatRoomsRaw extends BaseRaw<IOmnichannelRoom> implements ILive
{ key: { servedBy: 1 }, sparse: true },
{ key: { 'v.token': 1, 'email.thread': 1 }, sparse: true },
{ key: { 'v._id': 1 }, sparse: true },
// { key: { 't': 1, 'fname': 1, 'servedBy._id': 1, 'onHold': 1 } }, // created with username
// { key: { 't': 1, 'ts': -1, 'servedBy._id': 1, 'onHold': 1 } },
// { key: { 't': 1, 'closedAt': -1, 'servedBy._id': 1, 'onHold': 1 } },
{ key: { 'onHold': 1, 'ts': -1, 'servedBy._id': 1, 't': 1 } },
{ key: { 'servedBy._id': 1, 'departmentId': 1, 't': 1, 'open': 1, 'ts': -1 } },
{ key: { t: 1, departmentId: 1, closedAt: 1 }, partialFilterExpression: { closedAt: { $exists: true } } },
{ key: { source: 1 }, sparse: true },
{ key: { departmentAncestors: 1 }, sparse: true },
Expand Down Expand Up @@ -1336,6 +1333,9 @@ export class LivechatRoomsRaw extends BaseRaw<IOmnichannelRoom> implements ILive
query.onHold = { $ne: true };
}

console.log('query ->', query);
console.log('options.sort ->', options.sort);

return this.findPaginated(query, {
sort: options.sort || { name: 1 },
skip: options.offset,
Expand Down

0 comments on commit 295b94b

Please sign in to comment.