Correction exercice 3
Étape 1
db.inventory.updateMany(
{ qty: { $gte: 75 } },
{ $set: { scores: [19] } }
);
Étape 2
db.inventory.updateMany(
{ society: { $regex: /a/i } },
{ $push: { scores: 11 } }
);
Étape 3
db.inventory.find(
{ scores: 11 }
);
Étape 4
db.inventory.updateMany(
{ society: "Alex" },
{ $set: { comment: "Hello Alex" } }
);
Étape 5
db.inventory.find(
{ comment: { $exists: false } }
);
17 June 2025