跳到主要内容

IMutationContext

Defined in: packages/rxdb/src/repository/query.interface.ts:167

操作上下文

Extends​

Extended by​

Properties​

clientId?​

optional clientId?: string;

Defined in: packages/rxdb/src/rxdb.interface.ts:73

客户端唯一 ID

Remarks​

强烈不建议业务方手动写入:RxDB.init() 在 clientId 缺省时 自动生成 UUID 并固化为单例生命周期的一部分。手动赋值的字符串若与他 tab 冲突,pull/push 的"自己消息过滤"会失效,导致本 tab 把自己刚推送 的变更误判成他人变更再拉回来。

Inherited from​

RxDBContext.clientId


createdAt?​

optional createdAt?: Date;

Defined in: packages/rxdb/src/repository/query.interface.ts:178


returning?​

optional returning?: false;

Defined in: packages/rxdb/src/repository/query.interface.ts:171

是否返回数据


updatedAt?​

optional updatedAt?: Date;

Defined in: packages/rxdb/src/repository/query.interface.ts:176

自定义更新时间


userId?​

optional userId?: string;

Defined in: packages/rxdb/src/rxdb.interface.ts:62

当前登录用户 ID

适配器写实体行时用它填 createdBy / updatedBy 审计字段(实体声明了这两列才写)。 同步不按它做行级过滤;只同步一部分行要用 SyncType.Filter 的 remote.filter()。

Inherited from​

RxDBContext.userId