mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-23 16:04:38 +00:00
252533b2fd
[mongo-utils] create new home for batchedUpdate helper GitOrigin-RevId: 9f61c5e367a9f4cef63b5cc4c0bbbd3ef57c8ca8
20 lines
433 B
JavaScript
20 lines
433 B
JavaScript
import { db } from '../app/src/infrastructure/mongodb.js'
|
|
import { batchedUpdate } from '@overleaf/mongo-utils/batchedUpdate.js'
|
|
|
|
const tags = ['server-ce', 'server-pro', 'saas']
|
|
|
|
const migrate = async () => {
|
|
await batchedUpdate(
|
|
db.users,
|
|
{ 'features.templates': { $exists: true } },
|
|
{ $unset: { 'features.templates': true } }
|
|
)
|
|
}
|
|
|
|
const rollback = async () => {}
|
|
|
|
export default {
|
|
tags,
|
|
migrate,
|
|
rollback,
|
|
}
|