Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue in init/data.js #29

Open
sauravpanigrahi opened this issue Dec 30, 2024 · 0 comments
Open

issue in init/data.js #29

sauravpanigrahi opened this issue Dec 30, 2024 · 0 comments

Comments

@sauravpanigrahi
Copy link

While run the index.js data was not inserted into db so the solution is to change the schema

here is the corrected schema
const mongoose=require("mongoose");
const Schema=mongoose.Schema;

const listingSchema=new Schema({
title:{
type:String,
required:true,
},
description:String,
image: {
type: Map, // You can use a Map or an Object for the image
of: String, // if you expect the image to have filename and url
},
price:Number,
location:String,
country:String,
});

const Listing=mongoose.model("Listing",listingSchema);
module.exports=Listing;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant