skip to Main Content

mongodb query different array have different condition

I have the following datas. [{ "_id" : ObjectId("abc123"), "device_id": "A001", "A_status": "VALID", "B_status": "VALID" }, { "_id" : ObjectId("abc223"), "device_id": "A003", "A_status": "EXPIRED", "B_status": "VALID" }, { "_id" : ObjectId("abc323"), "device_id": "B001", "A_status": "EXPIRED", "B_status": "VALID" }, { "_id"…

VIEW QUESTION

Mongoose aggregate query working as a mongodb query but not able to convert to mongoose

Below is my JSON structure [{ "_id" : ObjectId("626204345ae3d8ec53ef41ee"), "categoryName" : "Test Cate", "__v" : 0, "createdAt" : ISODate("2022-04-22T01:26:11.627Z"), "items" : [ { "itemName" : "Cate", "user" : ObjectId("6260729af547915d9d876c23"), "itemDescription" : "slkkndanslk", "itemImage" : "/images/camping-table.jpeg", "_id" : ObjectId("626204339b24b2ead6c05a70"), "updatedAt" :…

VIEW QUESTION
Back To Top
Search