Skip to content

Latest commit

 

History

History

Delete Multiple Data

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

This function is the endpoint's request handler.

exports = function({ query, headers, body}, response) {
    var data=JSON.parse(query.data);
    var result="";
    
    //Check if there is null
    if (data)
    {
      result=data;
      // Querying a mongodb service:
      const doc = context.services.get("mongodb-atlas").db("Community").collection("KCYM");
      doc.deleteMany(data);
    }
    
    else
    {
      result="There is no data"
    }
    
    
    //Return the result
    return  result;
};