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

192
Views
How to add watchlist/wishlist item to mongoDb using nodejs and react js?

I Am trying to learn full-stack development using the MERN approach. I have a situation where when a user adds the item to its watchlist, which has the following filed

movie id
movie poster(an image)
movie name 
released date 

I want to store this to MongoDB Atlast using mongoose query and node.js

and such that when a user clicks on remove button on front-end it gets deleted.

However I know I have to use get, post, put, patch, delete APIs respectively. But my concern is, how is this possible or can be achieved when you have image type in your schema?

In short, how can I store the data which has an image for example below card?

img

Thanks for your help and your advice. Please see the Schema code below which am trying please do correct me where am wrong also advice me on related tutorial,

//on watchlistSchema.js
import { express } from "express";
import { mongoose } from "mongoose";

const watchlistSchema = mongoose.Schema({
    name: {
        type: String,
    },
    image: {
        type: Buffer,
    },
});

const watchlistItem = mongoose.model("newWatchlist", newWatchlistSchema);
module.exports = watchlistItem;

//on route.js
const watchlistItem = require("../model/watchlistSchema");
router.post("/watchlistitem", (req, res) => {
    res.send("hi ");
    console.log("watchlist item is here");
});

Trying to test on POSTMAN

img2

about 4 years ago · Juan Pablo Isaza
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!