✨ feat(诸子列传): 查询其他好友数据
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType, modelOptions } from '@typegoose/typegoose';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
|
||||
/**
|
||||
* 诸子百家
|
||||
@@ -28,8 +28,8 @@ export default class AuthorBook extends BaseModel {
|
||||
@prop({ required: true, default: [], type: Author, _id: false })
|
||||
authors: Author[];
|
||||
|
||||
public static async findByRoleId(roleId: string) {
|
||||
let result: AuthorBookType[] = await AuthorBookModel.find({ roleId }).select('-_id -roleId').lean();
|
||||
public static async findByRoleId(roleId: string, select = '-_id') {
|
||||
let result: AuthorBookType[] = await AuthorBookModel.find({ roleId }).select(select).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user