Skip to content

no port available, no flask-mongodb communication #1

@ndrini

Description

@ndrini

Hello Ishmeet,
I forked your project ( https://github.com/ndrini/PublicProjects/tree/hotfix/Python/MongoDB%20API ) and I discover several issues.

Please, have a look to branch hotfix.

  1. In the docker-compose file was missing
    ports:
    - "5000:27017"
    so no port was exposed

  2. no database initialization (no database IshmeetDB and collection people)

  3. no communication (even if manually create the database) inside the container

    $ docker exec -it feb99612817c bash
    root@feb99612817c:/# mongo

    use IshmeetDB > db.createCollection('people')
    db.people.insert({ "First_Name": "Barbara", "Age": 66 })
    WriteResult({ "nInserted" : 1 })
    db.people.find()
    { "_id" : ObjectId("60519022e03abca730129cc9"), "First_Name" : "Artur" }
    { "_id" : ObjectId("60519044e03abca730129cca"), "First_Name" : "Barbara", "Age" : 66 }
    db.people.insert({ "First_Name": "Carl", "Age": 96 })
    WriteResult({ "nInserted" : 1 })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions