You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
});
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;
The text was updated successfully, but these errors were encountered: