私は2つのモデルCRMモデルとCRM STATUSモデルを持っています。 _idとcrm_idは2つのモデルで同じです。 idは多くのステータス文書を持つことができます。私はnodejsのCRM STATUSモデルから各IDの最終更新ステータスを探したい。マングースは2つのモデルを結合してデータを取得します
CRM MODEL
"_id" : ObjectId("5a16a6481dac972b9cf22978"), /// join this
"updatedAt" : ISODate("2017-11-23T10:43:20.450Z"),
"createdAt" : ISODate("2017-11-23T10:43:20.450Z"),
"name" : "istiaque ahmad",
"shop_name" : "soul dance",
"address" : "dfsdfsd",
"phone" : "01764199657",
"email" : "[email protected]",
"website" : "facebook.com",
"comment" : "defdfsdfsdf",
"interest" : "ddsfsdfsdf",
"reference" : "dfsdfsdf",
"__v" : 0
CRMのSTATUS
"_id" : ObjectId("5a1a89041fe4313394da0db6"),
"updatedAt" : ISODate("2017-11-26T09:27:32.725Z"), ///last updated
"createdAt" : ISODate("2017-11-26T09:27:32.725Z"),
"crm_id" : "5a1a48c5796ee01e90b618b6", // join this
"name" : "nahid hasan",
"shop_name" : "gift gallary",
"status" : "dsadsdsada", /// find this
"__v" : 0