Giter VIP home page Giter VIP logo

Comments (5)

hamishwillee avatar hamishwillee commented on July 17, 2024

Did you do the challenge? https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose#genre_model_-_challenge!

The error seems to indicate that mongodb doesn't know about genres so it is possibly you didn't do that bit?

The populate.db assumes you did (I might need to make that clear - this is something you have to do)

If you did, the next step is to check that your models code matches the worked project here: https://github.com/mdn/express-locallibrary-tutorial/tree/main/models

from content.

SillyBorbo avatar SillyBorbo commented on July 17, 2024

Yes, challenge was done. I edited populatedb.js to skip genres and it has the same error with authors. Maybe this is a networking issue with mongodb? I am doing this on my work computer. I also know next to nothing about networking.

from content.

SillyBorbo avatar SillyBorbo commented on July 17, 2024

I finally found the problem. My mongodb url looked like:
...mongodb.net/local_library/?retryWrites=true...
When I removed the "/" just before the "?"
...mongodb.net/local_library?retryWrites=true...
It worked. I guess it was just my mistyping.

from content.

SillyBorbo avatar SillyBorbo commented on July 17, 2024

Now that I notice it, the error message
Invalid namespace specified 'local_library/.genres'
actually shows the problem. I expect that the "/" after local_library wouldn't be there if genres truly didn't exist and I had typed the correct url.

from content.

hamishwillee avatar hamishwillee commented on July 17, 2024

Glad you worked it out. Something for me to remember if I see the URL again.

from content.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.