Skip to content

Commit

Permalink
update for projectdao issue fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinovpankaj committed Apr 8, 2024
1 parent e81bc16 commit 5536715
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion model/projectDAO.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,22 @@ module.exports = {
}
}
});
}
},
addUpdateChildInSingleLevelProject: async (projectId, childId,childData) => {
return await mongo.Projects.updateOne({ _id: new ObjectId(projectId),"sections._id":ObjectId(childId) }, {
$set: {
"sections.$": childData
}
},{upsert:true}
);
},
addUpdateProjectChild : async (projectId, childId, childData)=>{
return await mongo.Projects.findOneAndUpdate({_id:ObjectId(projectId),"children._id":ObjectId(childId)},
{
$set:{
"children.$":childData
}
},{upsert:true}
);
}
};

0 comments on commit 5536715

Please sign in to comment.