-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: partenaire multi client api-depot
- Loading branch information
Showing
7 changed files
with
65 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const mongoClient = require('../utils/mongo-client') | ||
|
||
const collectionName = "partenaires-de-la-charte"; | ||
|
||
async function main() { | ||
await mongoClient.connect() | ||
|
||
const pdlcs = await mongoClient.db.collection(collectionName).find( | ||
{apiDepotClientId: {$ne: null}}, | ||
).toArray() | ||
|
||
for (const pdlc of pdlcs) { | ||
await mongoClient.db.collection(collectionName).updateOne( | ||
{_id: pdlc._id}, | ||
{$set: {apiDepotClientId: [pdlc.apiDepotClientId]}}, | ||
) | ||
} | ||
|
||
await mongoClient.disconnect() | ||
} | ||
|
||
main().catch(error => { | ||
console.error(error) | ||
process.exit(1) | ||
}).then(() => { | ||
process.exit(0) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters