Hey @sbrevolution5, did you set your env variable correctly?
When running your repl I get this error:
MongooseError: The uri parameter to openUri() must be a string, got “undefined”. Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string.
Meaning that
const uri = process.env.DB
is undefined.
May just be a case of repl.it, but may a starting point.
I think that is because of repl.it. I’m not seeing that error at all. I’ve updated the file and pasted the uri directly in so that there’s no confusion, It may simply be because the .env file is hidden for other users.
For the record. I get a connection successful log every time I run it. but I’m not seeing the save success log that I added when the document saves
Yeah, seems repl keeps the env variables hidden, and for good reasons
My suggestion is to keep it that way, and don’t show your connection string around, that’s a potential security issue.
With that out of the way we know it’s connecting.
Do you have the error log when saving a new issue?
Actually I made a mistake, wasn’t logging the error to the console. Looks like its that theres no ID field. This turned out to be because I had put _id in my schema, but not inserted a value. The easiest fix was to take it out of schema