Node is throwing the ‘ReferenceError: mangoose is not defined’ at me.
It states that the error is in this line:
const dogSchema = new mangoose.Schema({
I have instelled mongoose by npm
$ npm i mongoose
And here’s the code
const mongoose = require("mongoose");
mongoose.connect("mongodb://localhose:27017/fruitsDB")
const fruitSchema = new mangoose.Schema({
Can anyone recognise what the problem is?
I’ve required mongoose in the .js file and installed it via npm.
Thanks a lot!
2
Answers
You have a typo in line 3 of your code. It should be mongoose, not mangoose.
"mongoose" was spelled "mangoose" on line 3