Flutter and MongoDB #1 | Connection setup

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024

Комментарии • 22

  • @hutieu2880
    @hutieu2880 11 месяцев назад +2

    E/flutter (15189): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MongoDart Error: Db is in the wrong state: State.INIT
    error pls help me

  • @HafidzRizkiFahrizal
    @HafidzRizkiFahrizal Год назад

    thanks your explanation is easy to understand

  • @mohammedkushalgarhwala4479
    @mohammedkushalgarhwala4479 2 года назад +7

    Error: MongoDB ConnectionException: Could not connect to ac-x2lueh4-shard-00-00.vxyr9nh.mongodb.net:27017
    how to solve this exception

  • @speedtnt7591
    @speedtnt7591 2 года назад +1

    Thank you,
    before finding this tutorial i've been working on nodejs...for using mongodb and flutterbut here seems unnecessary, so what this nodejs is used for if we can make our models in flutter...?

    • @codewithkavit2581
      @codewithkavit2581  2 года назад

      So the reason I have a node backend system is that in the future if you want to scale your app or a service, then it helps in having a separate service.

    • @speedtnt7591
      @speedtnt7591 2 года назад

      @@codewithkavit2581 like authentication for login? So will you cover this one too with mongodb ?

    • @codewithkavit2581
      @codewithkavit2581  2 года назад

      @@speedtnt7591 so not in this series but I will make a full app video one day for full end to end flow.

    • @JoanCaron
      @JoanCaron 2 года назад

      @@codewithkavit2581 the first reason should be the security. Not a good security practice to store any kind of credential into a mobile app as it can be easily reverse engineered

    • @codewithkavit2581
      @codewithkavit2581  2 года назад +1

      @@JoanCaron you are totally correct Joan, I didn’t mean to show that this is the correct way, I just wanted to show how we can interact with Mongodb, when building my own app I would either use a backend or environment variables. But just for demo purposes, I have done it like this.

  • @9tontruck
    @9tontruck 2 года назад +1

    How can we secure the access id/password? I don't want them to be visible to other code-editors in the code

    • @codewithkavit2581
      @codewithkavit2581  2 года назад

      I didn’t get your question, so u will never hardcode id and password in the flutter code, so it won’t be seen to other engineers working on the same codebase.

    • @9tontruck
      @9tontruck 2 года назад

      @@codewithkavit2581 So is there a way to access the DB endpoint without hard-coding it? It's my question

    • @codewithkavit2581
      @codewithkavit2581  2 года назад

      @@9tontruck ohh yes there is, so you can have a backend service which directly interacts with the db and then you don’t have to worry about storing credentials on the flutter end, also u can add the credentials file to gitignore, so no other engineer can view it.

    • @chind0na
      @chind0na Год назад

      @@9tontruckor this reason I’m using Appwrite. Even though it doesn’t support MongoDB yet. But it’s in their roadmap.
      Oh it comes with Authentication and Authorization.

  • @sivashankarnagarajan7805
    @sivashankarnagarajan7805 2 года назад +1

    Hi, Thanks for the video. But when connecting to MongoDB, i'm getting this exception. Unhandled Exception: MongoDB ConnectionException: Socket error: 2.718281828459045.

    • @codewithkavit2581
      @codewithkavit2581  2 года назад

      That’s because you need to check what permissions you have set for the admin user who can access Mongodb. Just check that and try again. I think I have covered that in a video.

    • @akinbamitaofeek1315
      @akinbamitaofeek1315 2 года назад

      Goto Network Access from the dashboard, click edit and select allow from all addresses. That will solve it

    • @chaitanyapawar5483
      @chaitanyapawar5483 Год назад

      @@akinbamitaofeek1315 thank you so much🥺

  • @chind0na
    @chind0na Год назад

    Stopped watching @8:16 because you’re not calling an outside server for your CRUD operations.
    Why does that pub package even exist?