skip to Main Content

Mongodb – how to send data to mongo via URL?

i post data to mongodb as following: app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended:true})); app.use('/insert',async(req,res)=>{ const newProduct=new product({ _id:req.body._id, name:req.body.name, description:req.body.description }); try{ await newProduct.save(); // res.json(newProduct); res.send(`${newProduct} inserted.`); //res.redirect('/'); } catch(err){ res.send(err); } }); Data is taken from the user. The user sends the…

VIEW QUESTION

How to remove special characters from url? – Ios swift

let ids = [String: [String]] ids=%5B%4566abef1c-4462-4g62-bcc5-5ae10547104c%22,%20%1256efcf8c-6977-430d-b3ec-4ae80547101c%22%5D After appended and passing url params, response failing in response structure special symbol added in -> %5B%% https://baseUrl/endpoint?ids=4566abef1c-4462-4g62-bcc5-5ae10547104c,1256efcf8c-6977-430d-b3ec-4ae80547101c How to remove %22%5D from url? Here Code: let parms: [String: [String]] let urlString = "(baseUrl)/(endpoint)"…

VIEW QUESTION
Back To Top
Search