【问题标题】:(MongoDB Compass) lookup using let not working(MongoDB Compass) 使用 let 查找不起作用
【发布时间】:2021-10-05 12:27:03
【问题描述】:

不确定我的代码有什么问题需要帮助吗?

单位集合

_id: ObjectId("5fa571d148065e4ec8f77c12")
 actors:Array
 deals:Array
 name:"6th Floor"
 area:2500
 condition:"CATEGORY_A"
 organisation:ObjectId("5f7de0fbd0d5403fee33fb10")

组织集合

_id: ObjectId("5f7de0fbd0d5403fee33fb10")
 members:Array
 units:Array
 deals:Array
 templates:Array
 name:"ChApps Ltd"

输出

      {from: 'organisations',
      let: {_id: '$organisation'}
      pipeline: [{$match:{$expr:{$eq:['$_id','$$_id']}}}],
      as: 'compname'}

【问题讨论】:

    标签: mongodb mongodb-compass


    【解决方案1】:

    let: {_id: '$organisation'} 语句后缺少逗号,

    【讨论】:

      猜你喜欢
      • 2021-03-15
      • 2018-11-10
      • 2022-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-08
      • 2021-04-21
      • 2019-12-05
      相关资源
      最近更新 更多