MongoDB and Mongoose - Create Many Records with model.create()

Tell us what’s happening:

Hi, im trying, to solve this but i can’t do it every thing seems normal but it gives met this error:
Creating many db items at once should succeed

[Error: (Unauthorized) not authorized on admin to execute command { delete: “people”, deletes: [[{q } {limit 0}]], ordered: true, writeConcern: { w: “majority” }, lsid: { id: {4 [221 4 108 189 123 171 72 241 153 45 229 9 79 111 140 137]} }, $clusterTime: { clusterTime: {1705590954 5}, signature: { hash: {0 [131 221 124 68 56 143 65 12 131 95 161 236 194 78 121 178 109 215 243 206]}, keyId: 7288974519706845184.000000 } }, $db: “admin” }]

Here’s my code:

require('dotenv').config();
const mongoose = require('mongoose');
mongoose.connect(process.env.MONGO_URI);
const Schema = mongoose.Schema;

const personSchema = new Schema({
   name: { type: String, required: true },
   age: Number,
   favoriteFoods: [String]
});
let Person = mongoose.model("Person", personSchema)

const createAndSavePerson = (done) => {
  let Mike = new Person({
    name: "Mike", age: 6, favoriteFoods: ["catFood", "fish"]
  })
  
  Mike.save(function(err, data) {
    if (err) return console.error(err);
    done(null, data)
  });
};

solution: https://f9374419-93be-4cc5-97f3-384f611dec0b-00-1apnv4ubk1fnh.worf.replit.dev

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

MongoDB and Mongoose - Create Many Records with model.create()

Hi @joramiranda8,

We need to see all of the code, especially the parts applicable to this challenge. If you have a link to your specific Replit project for this, that would be great!