- Aggiornato node.js alla versione 22.18.1

- Aggiornato tutti i pacchetti del server all'ultima versione.
- passato mongoose da versione 5 a versione 6
This commit is contained in:
Surya Paolo
2025-03-03 00:46:08 +01:00
parent 45d06b0923
commit 53a70a1c96
120 changed files with 3385 additions and 6065 deletions

View File

@@ -68,10 +68,7 @@ bookingSchema.statics.findAllByUserIdAndIdApp = function (userId, idapp, sall) {
else
myfind = { userId, idapp, booked: true };
return Booking.find(myfind, (err, arrbooked) => {
// console.log('ris Booking:', arrbooked);
return arrbooked
});
return Booking.find(myfind).lean();
};
@@ -94,7 +91,7 @@ function getUsersByBooking(idapp) {
$Lookup: {
from: "users",
localField: "userId", // field in my collection
foreignField: "ObjectId(_id)", // field in the 'from' collection
foreignField: "new ObjectId(_id)", // field in the 'from' collection
as: "fromItems"
}
},
@@ -122,8 +119,9 @@ bookingSchema.statics.findAllDistinctByBooking = function (idapp) {
const Booking = mongoose.model('Booking', bookingSchema);
Booking.createIndexes((err) => {
if (err) throw err;
});
Booking.createIndexes()
.then(() => { })
.catch((err) => { throw err; });
module.exports = { Booking };