Skip to content

Commit

Permalink
save laureate dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Jun 13, 2024
1 parent e22c2e4 commit 530d77f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/jobs/opendata/fr_esr_paysage_laureats_all.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ export default async function exportFrEsrPaysageLaureatAll() {
}
});
console.log(json[0]);
// const session = client.startSession();
// await session.withTransaction(async () => {
// await db.collection('opendata').deleteMany({ dataset });
// await db.collection('opendata').insertMany(json);
// await session.endSession();
// });
const session = client.startSession();
await session.withTransaction(async () => {
await db.collection('opendata').deleteMany({ dataset });
await db.collection('opendata').insertMany(json);
await session.endSession();
});

return { status: 'success', location: `/opendata/${dataset}` };
}

0 comments on commit 530d77f

Please sign in to comment.