mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 11:00:39 -05:00
018a44eeb5
[misc] normalize mongo imports GitOrigin-RevId: ac653d9982e0d36736b90f4c03d4c00be88ea76a
22 lines
462 B
JavaScript
22 lines
462 B
JavaScript
const { db } = require('../../app/src/infrastructure/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)
|
|
})
|