Mongoose DB Solution not working

Tell us what’s happening:
I think i’ve made a working solution, also the hint is pretty the same, but it dont get accepted from FCC. Some ideas? Have i done something wrong?

Thanks for your attention,
WKD

My code:
const findOneByFood = function(food, done) {
Person.findOne({favoriteFoods: food}, function (err, data) {
if (err) return console.log(err);
done(null, data);
});
};

Your project link(s)

https://replit.com/join/htrrxcixoj-wkdminerva

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Use model.findOne() to Return a Single Matching Document from Your Database

Link to the challenge:

I just tested out your project on this challenge and it passes just fine. I assume you resolved your issue on your own.

No, today i get also an mongoose error so i cant start the repl. (no changes!) Yesterday this problem didnt show up, but the solution was not accepted… strange.
Anyway, maybe i try it anytime via Github repo and node.js…
The code is written and should work there, so it is not much work to swap…

Thank you for your answer!

Thrown repl error:
npm start

fcc-mongo-mongoose-challenges@0.0.1 start
node server.js

(node:2333) Warning: Accessing non-existent property ‘count’ of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:2333) Warning: Accessing non-existent property ‘findOne’ of module exports inside circular dependency
(node:2333) Warning: Accessing non-existent property ‘remove’ of module exports inside circular dependency
(node:2333) Warning: Accessing non-existent property ‘updateOne’ of module exports inside circular dependency
Your app is listening on port 3000
/home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/mongo_client_ops.js:474
throw err;
^

MongoError: database name must be a string
at Function.create (/home/runner/FCC-mongomongoose/node_modules/mongodb-core/lib/error.js:43:12)
at validateDatabaseName (/home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/db_ops.js:720:22)
at new Db (/home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/db.js:181:3)
at MongoClient.db (/home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/mongo_client.js:268:14)
at /home/runner/FCC-mongomongoose/node_modules/mongoose/lib/connection.js:533:62
at /home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/utils.js:414:17
at executeCallback (/home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/utils.js:406:9)
at /home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/mongo_client_ops.js:294:5
at connectCallback (/home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/mongo_client_ops.js:249:5)
at /home/runner/FCC-mongomongoose/node_modules/mongoose/node_modules/mongodb/lib/operations/mongo_client_ops.js:471:7
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
driver: true,
[Symbol(mongoErrorContextSymbol)]: {}
}
exit status 1

The error message about the database name typically means your MONGO_URI is missing the database name.

I found the problem with the database name: I have to set the newUrlParser to false:
{ useNewUrlParser: false }

In the setup assignment =>

FCC instruct to set it to true. I dont know what the problem is with it, but maybe this information is useful for you as Leader in future topics.

Anyway, if i pass my solution, it doesnt get accepted.
I have the same problem in this task: