skip to Main Content

Searching mongoDB not by primary id

I have a notification collection and inside I have documents like this : id: 6253ec60facb2ee68475510e; companyId: 6253asdsad0facb2ee68475510e; workStatus: true id: 6253ec60abcb2ee68475510e; companyId: 6253ec60afva2ee68475510e; workStatus: true I want to search documents by the companyId and not id. When I do this…

VIEW QUESTION

Mongodb – Query document count by multiple ranges returning range start/end with matching element count

I've been trying to create a query on documents like these: [ { "timestamp": new ISODate('2020-01-01T00:00:00'), "objectId": "Id_A", "locationId": "Location_A" }, { "timestamp": new ISODate('2021-01-01T00:00:00'), "objectId": "Id_A", "locationId": "Location_A" }, { "timestamp": new ISODate('2022-01-01T00:00:00'), "objectId": "Id_A", "locationId": "Location_B" }, {…

VIEW QUESTION
Back To Top
Search