HELP, Plz. I don’t know what I’m missing here the link is below to my code. Been stuck on this for a few days now, tried it several ways no luck. PLZ help * Users name and password changed to protect the innocent. LOL
/**********************************************
* 3. FCC Mongo & Mongoose Challenges
* ==================================
***********************************************/
/** # MONGOOSE SETUP #
/* ================== */
/** 1) Install & Set up mongoose */
var mongodb = require('mongodb');
var mongoose = require('mongoose');
mongoose.connect('mongodb+srv://users:password@cluster0-susby.mongodb.net/test?retryWrites=true&w=majority');
// Add `mongodb` and `mongoose` to the project's `package.json`. Then require
// `mongoose`. Store your **mLab** database URI in the private `.env` file
// as `MONGO_URI`. Connect to the database using `mongoose.connect(<Your URI>)`
/** # SCHEMAS and MODELS #
/* ====================== */
/** 2) Create a 'Person' Model */
// First of all we need a **Schema**. Each schema maps to a MongoDB collection
// and defines the shape of the documents within that collection. Schemas are
// building block for Models. They can be nested to create complex models,
// but in this case we'll keep things simple. A model allows you to create
// instances of your objects, called **documents**.
// Create a person having this prototype :
// - Person Prototype -
// --------------------
// name : string [required]
// age : number
// favoriteFoods : array of strings (*)
// Use the mongoose basic *schema types*. If you want you can also add more
// fields, use simple validators like `required` or `unique`, and set
// `default` values. See the [mongoose docs](http://mongoosejs.com/docs/guide.html).
// <Your code here >
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var personSchema = new Schema({
name :{
type: String,
required: true
},
age: {
type: Number,
},
favoriteFood: {
type: [String],
}
});