Hello community
I got stuck in the MongoDB & Mongoose section
I read hints and even try their code but i still can’t pass the test
this is the error i get:
Creating many db items at once should succeed (Test timed out)
project link(s)
solution: https://replit.com/@nimaposhtiban/boilerplate-mongomongoose
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Challenge: Create Many Records with model.create()
Link to the challenge:
dlaub3
#2
I see the code for Person
schema but nothing for People
. How are you creating the schema for People
?
People.create(arrayOfPeople,(err,people)=>{
if (err) return console.log(err)
done(null,people)
})
1 Like
My bad , i fixed that and changed it to Person,
Still getting the same error
dlaub3
#5
It looks like you aren’t connecting to Mongo with connect
.
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGO_URI);
var personSchema = new mongoose.Schema({
name: String,
age: Number,
favoriteFoods: [String]
});
You could try console logging mongoose.connection
before an after calling connect
so you can verify.
1 Like
system
closed
#6
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.