Bmob Pointer 一对多约束查询

笔记详情表Notes
在这里插入图片描述
分类表classification
在这里插入图片描述

实现效果查询出,笔记详情表Notes中和分类表中 aaa 分类关联的数据

  • 其中 aaa 的 objectId 为 8kvYcccq

代码实现

  
    const pointer = Bmob.Pointer('classification') 
      //poiID  为 Notes表 的 Pointer对象 关联的分类表aaa的objectId 
    const poiID = pointer.set('8kvYcccq')
    //查询笔记详情表 中 和分类表aaa有关的数据有关的
    const query = Bmob.Query('Notes')
    // 笔记详情表Pointer类型 字段 名称  和 Pointer类型指向的分类表objectId
    query.equalTo("title", "==", poiID);
    query.find().then(res => {
      console.log(res)
    })

查询结果
在这里插入图片描述

posted @ 2020-12-08 17:10  Muliminty  阅读(62)  评论(0)    收藏  举报