In mongosh, you can delete from multiple collections with by iterating an array, just like the previous journal’s query example:
["collection1", "collection2", "collection3", "collection4"].forEach((c) =>
db.getCollection(c).deleteMany({}),
); In mongosh, you can delete from multiple collections with by iterating an array, just like the previous journal’s query example:
["collection1", "collection2", "collection3", "collection4"].forEach((c) =>
db.getCollection(c).deleteMany({}),
);