Mongodb – findIndex() with async callback with mongoose.findById() inside always returning 0
I am creating simple queing system with tickets. The ticket is inserted into array in place of first ticket with visitTime greater than one to be inserted. The array contains only ticketIds, which have to be looked up in Mongo…