Mikro orm:使用原始查询查找和计数

问题描述

大家好,我正在使用 Mikro ORM,我想向我的存储库的 findAndCount 方法添加原始查询

我有以下实体:

人员:

@Property({ nullable: false })
firstName: string;

@Property({ nullable: false })
lastName: string;

@Property({ nullable: false,default: '' })
email: string;

@property()
deletedAt: string;

所以我想得到所有,其中deletedAt不是NULL,deletedAt有一些价值

到目前为止我有这个,但我不知道如何在我的子句中包含 where deletedAt is not NULL ://

   const options = { offset: 5
            limit: 10,populate: ['company'] }

 return this.findAndCount({},options);

编辑:潜在解决方


发现这个查询也有效,如果有人需要它

return this.findAndCount({ deletedAt: { $ne: null } },options);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)