mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 06:40:48 +00:00
9cc5dc968c
.../js/... -> .../src/... GitOrigin-RevId: ab509c633529440f05247d19c320ebb77d506768
31 lines
609 B
JavaScript
31 lines
609 B
JavaScript
const mongojs = require('../../app/src/infrastructure/mongojs')
|
|
const { db, ObjectId } = mongojs
|
|
const Async = require('async')
|
|
|
|
const projectIds = [
|
|
// put ids here
|
|
]
|
|
|
|
Async.eachLimit(
|
|
projectIds,
|
|
5,
|
|
(projectId, cb) => {
|
|
db.projects.update(
|
|
{ _id: ObjectId(projectId) },
|
|
{
|
|
$unset: { tokens: 1 },
|
|
$set: { publicAccesLevel: 'private' }
|
|
},
|
|
err => {
|
|
if (err) return cb(err)
|
|
console.log(`Deactivated tokens for ${projectId}`)
|
|
cb()
|
|
}
|
|
)
|
|
},
|
|
err => {
|
|
if (err) throw err
|
|
console.log('>> Done')
|
|
process.exit(0)
|
|
}
|
|
)
|