mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
15 lines
No EOL
496 B
CoffeeScript
15 lines
No EOL
496 B
CoffeeScript
{db, ObjectId} = require "./mongojs"
|
|
|
|
module.exports = MongoManager =
|
|
findProject: (project_id, callback = (error, project) ->) ->
|
|
db.projects.find _id: ObjectId(project_id.toString()), {}, (error, projects = []) ->
|
|
callback error, projects[0]
|
|
|
|
updateDoc: (project_id, docPath, lines, callback = (error) ->) ->
|
|
update =
|
|
$set: {}
|
|
$inc: {}
|
|
update.$set["#{docPath}.lines"] = lines
|
|
update.$inc["#{docPath}.rev"] = 1
|
|
|
|
db.projects.update _id: ObjectId(project_id), update, callback |