【问题标题】:Mongo Fetching multiple collections queryMongo获取多个集合查询
【发布时间】:2021-04-16 06:13:54
【问题描述】:

我正在练习并且对 MongoDb 数据库查询非常陌生。我有三个集合数据。一个系列是客户,一个系列是客户的包,最后一个系列是客户的布。他们每个人都与id连接。我正在使用MongoDB package 进行连接和查询。我的目标是当客户的布料被出售时,它会从我想要获取客户信息的 bagId 中查找 bagId。 .我真的不知道如何查询这个 MongoDB。

我的客户数据是这样的

_id:058585821193645242
accountNumber:"GI-325202"
address:"Calfornia"
city: "Calfornia"
email: "customer@gmail.com"
firstName:"John"
lastName:"doe"
name: "John doe"
phoneNumber: "0000-000"
customerId: 1200 // this id is connected with my bag collection

这是包包系列

  bagId:119
  customerId:1200 // this my customer Id 

这是我的 Cloth 收藏

clothId: 123
bagId: 119 
status: sold. // this is my cloth status

clothId: 123
bagId: 119 
status: not sold. // this is my cloth status

【问题讨论】:

    标签: mongodb mongodb-query


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-18
    • 1970-01-01
    • 2019-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-06
    相关资源
    最近更新 更多