Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
how to keep account of which user has posted which record in mongoDB database

I am working on MERN project, where users can post ads of their vehicles and other user can see these ads. I want that only the use who has submitted a vehicle ad will be allowed two delete that specific ad.I have to different mongoDB schema for user and vehicles ad and successfully storing and fetching users and vehicle data from mongoDB.I have no idea how this can be done. Can some guide me how it can be possible?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You would add an identifier to your Vehicles collection to know which User is the owner of the Vehicle

{
  "_id": "12345",
  "description": "Vehicle for sell",
  "userId": "Your user _id goes here or any other unique identifier for user"
}

and then upon request to Update / Delete an ad you check whether requesting user has same id as userId in Vehicles collection.h

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!