skip to Main Content

MongoDB – How to aggregate with deeply nested arrays

I have the following MongoDB structure: Division Collection: { "_id": ObjectId("5b28cab902f28e18b863bd36"), "name": "Premier League", ... "teams": [ ObjectId("5b28cab902f28e18b863bd01"), ObjectId("5b28cab902f28e18b863bd02"), ObjectId("5b28cab902f28e18b863bd03"), ... ] ... }, ... Teams Collection: { "_id": ObjectId("5b28cab902f28e18b863bd01"), "name": "Liverpool", ... "players": [ ObjectId('5b23tmb902f28e18b863bd01'), ObjectId('5b23tmb902f28e18b863bd02'), ObjectId('5b23tmb902f28e18b863bd03'), ... ]…

VIEW QUESTION

MongoDB find number

I am adding MongoDB into my discord bot, I have it set so when something happens it does await ticketSchema.findOneAndUpdate( { $inc: { ticketNumber: 1 } } ) That all works fine, its when I try to find it later…

VIEW QUESTION
Back To Top
Search