Skip to content

Commit

Permalink
fix(mongo-models/api): Fixes for indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Oct 23, 2020
1 parent 1297188 commit 916e47a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/shared/content/content.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export abstract class ContentService {
switch (contentArgs.sort) {
case 'name':
return {
title: order
title: 1
}

case 'rating':
Expand Down Expand Up @@ -68,7 +68,7 @@ export abstract class ContentService {
default:
return {
'rating.votes': order,
'rating.precentage': order,
'rating.percentage': order,
'rating.watching': order
}
}
Expand Down
12 changes: 12 additions & 0 deletions libs/mongo-models/src/movie/movie.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,16 @@ export const movieSchema = (new Schema(
'rating.watching': 1
}).index({
'bookmarked': 1
}).index({
'released': 1
}).index({
'year': 1
}).index({
'createdAt': 1
}).index({
'rating.votes': 1,
'rating.percentage': 1,
'rating.watching': 1,
}).index({
'title': 1,
})
11 changes: 11 additions & 0 deletions libs/mongo-models/src/show/show.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,15 @@ export const showSchema = (new Schema(
'rating.watching': 1
}).index({
'bookmarked': 1
}).index({
'released': 1,
'latestEpisode': 1
}).index({
'createdAt': 1
}).index({
'rating.votes': 1,
'rating.percentage': 1,
'rating.watching': 1,
}).index({
'title': 1,
})

0 comments on commit 916e47a

Please sign in to comment.