Я хочу заменить "\\" на "/" в productImage , мой код, как показано ниже, я использовал метод замены , но не работал , жду вашей помощи спасибо
const response = {
count: docs.length,
products: docs.map(doc => {
return {
name: doc.name,
price: doc.price,
productImage: doc.productImage,
_id: doc._id,
request: {
type: "GET",
url: url + "/products/" + doc._id
}
};
})
};
Мой вывод JSON
{
"name": " Sample Product",
"price": 45,
"productImage": "uploads\\2018-05-02T09-12-59.937Zahmet.jpg",
"_id": "5ae9811be170eb0a78500088",
"request": {
"type": "GET",
"url": "http://localhost:3000/products/5ae9811be170eb0a78500088"
}
},