mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
9cc5dc968c
.../js/... -> .../src/... GitOrigin-RevId: ab509c633529440f05247d19c320ebb77d506768
23 lines
486 B
JavaScript
23 lines
486 B
JavaScript
const mongojs = require('../../app/src/infrastructure/mongojs')
|
|
const { db } = mongojs
|
|
|
|
const keys = { 'tokens.readAndWritePrefix': 1 }
|
|
const opts = {
|
|
unique: true,
|
|
partialFilterExpression: {
|
|
'tokens.readAndWritePrefix': { $exists: true }
|
|
},
|
|
background: true
|
|
}
|
|
|
|
console.log(
|
|
`>> Creating index on ${JSON.stringify(keys)}, ${JSON.stringify(opts)}`
|
|
)
|
|
|
|
db.projects.createIndex(keys, opts, err => {
|
|
if (err) {
|
|
throw err
|
|
}
|
|
console.log('>> done')
|
|
process.exit(0)
|
|
})
|