Json array support realtime relation

field setting

let ContentModelFields.option(jsonb) = {
    withRealtimeRelation:true,
    RealtimeRelation:{
        tableName:'values',
        type:'OneToMany', // 暂时没用    
    }

}

script to modify data(或者手动)

- fieldsNeedModify
    - 取出Value表所有的category
- 遍历ContentModelFields
    - 如果in fieldsNeedModify
        - 统一修改tableName为Value

插入逻辑

无变化

查询逻辑参考

1. `let RealTimeRelationHash={},RealTimeFieldsArray=[]`,   正常查询流程
2. 遍历option不为null并且`withRealtimeRelation`为`true`的字段,  并记录到RealTimeFieldsArray
3. 记录所有需要更新的 RealTimeRelationHash['tableName'].ids= [3,30001,50001] 
4. 根据不同table的ids查询所有要用到的记录RealTimeRelationHash['tableName'].records = [{id:3,title:'xxxx'},{id:30001,title:'yyyy'}] //也可以存object
5. 根据RealTimeFieldsArray更新result中的数据
    - find in records -> 取出record更新
    - else -> 不处理

results matching ""

    No results matching ""