MongoDB and Mongoose - Create and Save a Record of a Model

I am trying to complete the challenge https://www.freecodecamp.org/learn/back-end-development-and-apis/mongodb-and-mongoose/create-and-save-a-record-of-a-model

my code seems not to work and I do not know why

this is the boiler plate link


Your project link(s)

Your browser information:

the boiler plate link (boilerplate-mongomongoose - Replit)

image
image
image

The first screen shot is my secret to connect to mongodb with my password covered
and the other two are the console before and after I submit the code on freecode camp

I allowed any ip address


I do not understand what you mean by correct permissions

I gave admin the access without any specific restriction

May I ask do I need to include the database name in the uri

I always restart each time I make a change

I figured it out. I just noticed that your user does not have read and write privileges. You need to click EDIT for the user and on the next screen, under Built-in Role, you need to select Read and write to any database. These instructions were in the tutorial shown in the first challenge of this curriculum section.

Thank you, it works now that was an omission on my end

How do you Select read and write in Mongo Atlas?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.