I have an array of arrays that gets returned from a mongo query. I want to take and remove the first item/element in each array. Here is my node route
Route partial
let queries = [
User.find({"companyID":req.user.companyID}, (err, foundUsers) => {
if (err) throw err;
}),
];
Promise.all(queries)
.then(results => {
res.render('hr/employees', {header: 'EMPLOYEES', users: results[0]});
}).catch( err => {
req.flash('error', err);
res.render('hr/employees', {header: 'EMPLOYEES'});
});
Sample arrays
What I have now
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
What I want
[[2, 3], [5,6], [8,9]]