Skip to content

Commit

Permalink
perf: add read reference
Browse files Browse the repository at this point in the history
  • Loading branch information
mdwitr0 committed Apr 4, 2024
1 parent 5bf306a commit c6d8160
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/configs/mongo.config.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const READ_PREFERENCE = ' secondaryPreferred';
export const READ_PREFERENCE = 'secondaryPreferred';
1 change: 1 addition & 0 deletions src/image/schemas/image.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type ImageDocument = HydratedDocument<Image>;
},
},
toObject: { virtuals: true },
read: READ_PREFERENCE,
})
export class Image {
@ApiProperty()
Expand Down
1 change: 1 addition & 0 deletions src/keyword/schemas/keyword.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type KeywordDocument = HydratedDocument<Keyword>;
toJSON: { virtuals: true },
toObject: { virtuals: true },
collection: 'keywords',
read: READ_PREFERENCE,
})
export class Keyword {
@ApiProperty()
Expand Down
1 change: 1 addition & 0 deletions src/list/schemas/list.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type ListDocument = HydratedDocument<List>;
},
},
toObject: { virtuals: true },
read: READ_PREFERENCE,
})
export class List {
@ApiNullableProperty()
Expand Down
1 change: 1 addition & 0 deletions src/movie/schemas/movie-award.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type MovieAwardDocument = HydratedDocument<MovieAward>;
toJSON: { virtuals: true },
toObject: { virtuals: true },
collection: 'movies-award',
read: READ_PREFERENCE,
})
export class MovieAward extends Award {
@ApiNullableProperty()
Expand Down
1 change: 1 addition & 0 deletions src/movie/schemas/movie.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ export type MovieDocument = HydratedDocument<Movie>;
toJSON: { virtuals: true },
toObject: { virtuals: true },
collection: 'movies',
read: READ_PREFERENCE,
})
export class Movie {
// INFO: Id values
Expand Down
1 change: 1 addition & 0 deletions src/person/schemas/person-award.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type PersonAwardDocument = HydratedDocument<PersonAward>;
toJSON: { virtuals: true },
toObject: { virtuals: true },
collection: 'people-award',
read: READ_PREFERENCE,
})
export class PersonAward extends Award {
@ApiProperty()
Expand Down
1 change: 1 addition & 0 deletions src/person/schemas/person.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export type PersonDocument = HydratedDocument<Person>;
timestamps: true,
toJSON: { virtuals: true },
toObject: { virtuals: true },
read: READ_PREFERENCE,
})
export class Person {
@ApiProperty()
Expand Down
1 change: 1 addition & 0 deletions src/review/schemas/review.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type ReviewDocument = HydratedDocument<Review>;
timestamps: true,
toJSON: { virtuals: true },
toObject: { virtuals: true },
read: READ_PREFERENCE,
})
export class Review {
@ApiProperty()
Expand Down
1 change: 1 addition & 0 deletions src/search-sync/schemas/search-sync.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type SearchSyncDocument = HydratedDocument<SearchSync>;
timestamps: true,
toJSON: { virtuals: true },
toObject: { virtuals: true },
read: READ_PREFERENCE,
})
export class SearchSync {
@Prop({ index: true })
Expand Down
1 change: 1 addition & 0 deletions src/season/schemas/season.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export type SeasonDocument = HydratedDocument<Season>;
timestamps: true,
toJSON: { virtuals: true },
toObject: { virtuals: true },
read: READ_PREFERENCE,
})
export class Season {
@ApiProperty()
Expand Down
1 change: 1 addition & 0 deletions src/studio/schemas/studio.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type StudioDocument = HydratedDocument<Studio>;
timestamps: true,
toJSON: { virtuals: true },
toObject: { virtuals: true },
read: READ_PREFERENCE,
})
export class Studio {
@ApiProperty()
Expand Down

0 comments on commit c6d8160

Please sign in to comment.