mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-19 00:24:20 -05:00
13 lines
344 B
CoffeeScript
13 lines
344 B
CoffeeScript
|
mongojs = require("../../infrastructure/mongojs")
|
||
|
db = mongojs.db
|
||
|
ObjectId = mongojs.ObjectId
|
||
|
|
||
|
module.exports = UserUpdater =
|
||
|
updateUser: (query, update, callback = (error) ->) ->
|
||
|
if typeof query == "string"
|
||
|
query = _id: ObjectId(query)
|
||
|
else if query instanceof ObjectId
|
||
|
query = _id: query
|
||
|
|
||
|
db.users.update query, update, callback
|