Category talk:Start-Class Microsoft articles

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
WikiProject iconMicrosoft Category‑class
WikiProject iconThis category is within the scope of WikiProject Microsoft, a collaborative effort to improve the coverage of articles relating to Microsoft on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CategoryThis category does not require a rating on Wikipedia's content assessment scale.

Data saya seperti ini { _id: ObjectId("65452b234ca83afdf10ed48a"), nama: "charger", password: "elektronik", rahasia: "1000" } alamatnya seperti ini app.get("/products/delete/:id", hapusData); pada kode program ini saya memasukkan id = 1234567890123456789012345 tapi fungsi !validator.isMongoId(id) tidak terpanggil malah error http://localhost:3000/products/delete/1234567890123456789012345 Situs ini tidak dapat dijangkaulocalhost menolak untuk terhubung. Coba:

Periksa sambungan Memeriksa proxy dan firewall ERR_CONNECTION_REFUSED berikut kodenya async function hapusData(req, res) {

 const validator = require("validator");
 const id = req.params.id;
 const hasilCari = await client
   .db("Tugas")
   .collection("daftar_produk")
   .findOne({ _id: new ObjectId(id) });
 if (hasilCari === null) {
   res.status(404).send("Produk tidak ditemukan");
 }
 if (!validator.isMongoId(id)) {
   res.send("Id tidak valid");
   return;
 }
 if (hasilCari !== null) {
   await client
     .db("Tugas")
     .collection("daftar_produk")
     .deleteOne({ _id: new ObjectId(id) });
   res.status(200).send("Produk berhasil dihapus");
 }

} 2404:C0:1C10:0:0:0:B67:5EB4 (talk) 06:11, 4 November 2023 (UTC)[reply]