Skip to content

Commit

Permalink
feat(mongoose): Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed Oct 16, 2020
1 parent 6deeef0 commit 7715ce7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ describe('MongooseQueryService', () => {

class TestEntityService extends MongooseQueryService<TestEntity> {
constructor(@InjectModel(TestEntity.name) readonly model: Model<TestEntity>) {
super(model, { documentToObjectOptions: { virtuals: true } });
super(model);
TestEntityModel = model;
}
}

class TestReferenceService extends MongooseQueryService<TestReference> {
constructor(@InjectModel(TestReference.name) readonly model: Model<TestReference>) {
super(model, { documentToObjectOptions: { virtuals: true } });
super(model);
TestReferenceModel = model;
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/query-mongoose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"peerDependencies": {
"@nestjs/common": "^7.0.0",
"@nestjs/mongoose": "^7.0.0",
"class-transformer": "^0.2.3 || ^0.3.0",
"mongoose": "^5.10.0",
"mongodb": "^3.6.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@ export interface MongooseQueryServiceOpts {
export class MongooseQueryService<Entity extends Document>
extends ReferenceQueryService<Entity>
implements QueryService<Entity, DeepPartial<Entity>, DeepPartial<Entity>> {
protected readonly documentToObjectOptions: DocumentToObjectOptions;
readonly filterQueryBuilder: FilterQueryBuilder<Entity> = new FilterQueryBuilder();

readonly filterQueryBuilder: FilterQueryBuilder<Entity>;

constructor(readonly Model: MongooseModel<Entity>, opts?: MongooseQueryServiceOpts) {
constructor(readonly Model: MongooseModel<Entity>) {
super();
this.documentToObjectOptions = opts?.documentToObjectOptions || { virtuals: true };
this.filterQueryBuilder = new FilterQueryBuilder();
}

/**
Expand Down

0 comments on commit 7715ce7

Please sign in to comment.