Closed wgcairui closed 2 years ago
这个删了么,把 entity 也贴一下。
此外, entities 不需要写后缀,entities: ['**/entity/']
没有使用EntityModel
entity
import { modelOptions, prop, Ref } from '@typegoose/typegoose';
import { Schema } from 'mongoose';
class Devprotocol {
@prop({ enum: [485, 232], default: 485 })
public Type: number;
@prop()
public Protocol: string;
}
/**
* 设备信息
*/
@modelOptions({ schemaOptions: { collection: 'device.types' } })
export class DevType {
@prop()
public Type!: string;
@prop()
public DevModel!: string;
@prop({ type: () => Devprotocol })
public Protocols: Devprotocol[];
}
// 关联实体
entities: ['**/entity']
后戳改了也一样
@wgcairui 给我一个可复现的最小 demo ?
不好弄,我连了五六个服务,不好拆分,先这样用吧,我mongo也没有多库的需求,后面自己新建一个v3的demo看看
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
当我有一个default默认数据库配置,mongoose.connections中有两个连接,此时任何请求操作都导致Operation
*.findOne()
buffering timed out after 10000ms 超时,但是我把mongoose.connections[0]中的连接配置调整为default之后,工作都正常了,我从midway V2版本更新上来的,是不是哪里没有配置? 之前core@3.1.6版本还好的config.default.ts配置
我的补救措施