I'm getting the error in my schema file. This is my code.
var mongoose = require('mongoose');
var jobListSchema = mongoose.Schema({
companyName: String,
jobtitle: String,
location: String
});
const JobList = module.exports('JobList',jobListSchema);
This is my error:
TypeError: module.exports is not a function at Object. (D:\product\project-1\models\joblist.js:9:24) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object. (D:\product\project-1\routes\users.js:8:17) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18)
module.exports = mongoose.model('JobList', jobListSchema);
– num8er