From e1dbde08bf9f3926fad9518a21eef7075012d444 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Fri, 25 Sep 2020 22:46:06 +0200 Subject: [PATCH] feat(mongo-modals): Added new indexes --- libs/packages/mongo-models/src/movie/movie.schema.ts | 4 ++-- libs/packages/mongo-models/src/season/season.schema.ts | 3 +++ libs/packages/mongo-models/src/show/show.schema.ts | 4 +--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/packages/mongo-models/src/movie/movie.schema.ts b/libs/packages/mongo-models/src/movie/movie.schema.ts index 9f99f08..2accd7b 100644 --- a/libs/packages/mongo-models/src/movie/movie.schema.ts +++ b/libs/packages/mongo-models/src/movie/movie.schema.ts @@ -21,6 +21,6 @@ export const movieSchema = (new Schema( collection: 'movies' } )).index({ - title: 'text', - _id: 1 + 'watched.complete': 1, + 'rating.watching': 1 }) diff --git a/libs/packages/mongo-models/src/season/season.schema.ts b/libs/packages/mongo-models/src/season/season.schema.ts index ab8c603..a876a7d 100644 --- a/libs/packages/mongo-models/src/season/season.schema.ts +++ b/libs/packages/mongo-models/src/season/season.schema.ts @@ -24,4 +24,7 @@ export const seasonSchema = (new Schema( } )).index({ showImdbId: 1, +}).index({ + showImdbId: 1, + number: 1, }) diff --git a/libs/packages/mongo-models/src/show/show.schema.ts b/libs/packages/mongo-models/src/show/show.schema.ts index 8e08072..14609a5 100644 --- a/libs/packages/mongo-models/src/show/show.schema.ts +++ b/libs/packages/mongo-models/src/show/show.schema.ts @@ -27,7 +27,5 @@ export const showSchema = (new Schema( collection: 'shows' } )).index({ - title: 'text', - synopsis: 'text', - _id: 1 + 'rating.watching': 1 })