The Query Method to add
Rest
...params: any[]Rest
interface FindHelpers {
findByTitle: AsQueryMethod<typeof findByTitle>;
}
function findByTitle(this: ReturnModelType<typeof Event, FindHelpers>, title: string) {
return this.find({ title });
}
@queryMethod(findByTitle)
class Event {
@prop()
public title: string;
}
const EventModel = getModelForClass<typeof Event, FindHelpers>(Event);
Generated using TypeDoc
Adds a query method to the Class which will then be added to the Schema.