skip to Main Content

MongoDB : – $lookup array inside object

I have 3 collections User, Attendance, Detection User collection Document { "_id": "60dd781d4524e6c116e234d2", "workerFirstName": "AMIT", "workerSurname": "SHAH", "workerId": "1001", "locationName": "HEAD OFFICE", "workerDesignation": "IT", "workerDepartment": "IT", }, Attendance Document { "_id": "61307cee85b5055a15cf01b7", "employeeId":"60dd781d4524e6c116e234d2", "Date": "2022-11-01T00:00:00.000Z", "duration": null, "createdAs": "FULL-DAY", "detections":…

VIEW QUESTION

mongodb. how map strings to integers from another collection

I have collection with documents, for example: [ { 'id':'1' 'some_field':'test', 'rates':[ {'user_id':'12','rate':'very_good'}, {'user_id':'13','rate':'very_good'} {'user_id':'14','rate':'bad'}, {'user_id':'15','rate':'normal'} ] } ] And i have collection with values of rates in string: [ { "rate_name" : "bad", "rate_value" : 1 }, { "rate_name"…

VIEW QUESTION
Back To Top
Search