Apply for Zend Framework Certification Training

NodeJs





Step 1


const userSchema = require('../../models/userModel/userSchema');
const chatSchema = require('../../models/userModel/chatSchema');

const deletemessage = async (req, res) => {
  try{
    const _id = req.headers.decoded_id;
    chatSchema.deleteOne( {"_id": req.body.messageId}).exec((err,data)=>{
      return apiResponse.successResponseWithData(res,'deleted',data);
    });
  } catch (e) {
    return apiResponse.ErrorResponse(res, e.message || e);
  }
}

< Make chat using node mongoodb socketIo Difference between npx and npm >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top