mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
bbaca91e57
Use only that method to find users by email.
15 lines
392 B
CoffeeScript
15 lines
392 B
CoffeeScript
mongojs = require("../../infrastructure/mongojs")
|
|
metrics = require("metrics-sharelatex")
|
|
db = mongojs.db
|
|
ObjectId = mongojs.ObjectId
|
|
logger = require('logger-sharelatex')
|
|
|
|
module.exports = UserLocator =
|
|
|
|
findById: (_id, callback)->
|
|
db.users.findOne _id:ObjectId(_id+""), callback
|
|
|
|
[
|
|
'findById',
|
|
].map (method) ->
|
|
metrics.timeAsyncMethod UserLocator, method, 'mongo.UserLocator', logger
|