Relative Content

Tag Archive for javascriptnode.jsmongodbexpress

Endpoints working but views are not loading why?

This is a file sharing system made with mainly nodejs,express,bootstrap and mongodb. i tried creating th eregister page and it was working but i changed the logic now it’s just not working and i don’t know what to do. The post endpoint for the register page is meant to add a user to the database if no user is found but it only shows the error popup even when its a new user, what should i do?

Getting Error: 11000 in user registration form

so i was just making a normal user registration form using react + express js + mongodb , and i am running into an issue where if i try to register the user for the first time it works properly but if i try to add another user it gives me error 11000The structure for the frontend code is something like this :there are three component files: Signup form, Basic Info, Part1Signup Form.js

Delete event in mongoDB not return full document

i have like this change event in which i have created one handleDelete method but after delete on mongoDB it only gives that document Id but when i trying to fetch that document using this
it is return null all time

Moongose findOneAndDelete() not working with certain parameters

I am making contact CRUD application with node.js, express and monogo. In my delete function, with the help of Postman I am able to delete contacts by ID, but if I try to delete by name or number I get an error saying:
path: ‘_id’,
“BSONError: input must be a 24 character hex string, 12 byte Uint8Array, or an integer at new ObjectId”