Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    how to add longditude/langditude to DB - float?

    Cloud Backend (Cloud DB, API Builder)
    3
    8
    490
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Linda MacDonald
      Linda MacDonald last edited by Linda MacDonald

      Hey there folks hope all is well? 🙂 does anyone here know how to add geolocation info to the database - is it float? or is there a better/optimized way?
      thanks in advance
      Linda

      thanks in advance
      Linda

      1 Reply Last reply Reply Quote 1
      • Pierre SULPICE
        Pierre SULPICE last edited by

        Hello Linda,

        Here is a nice representation of the precision you'll have depending your choice : http://mysql.rjweb.org/doc.php/latlng
        float would be 1.7m, so it all depends what you want to do with it.

        Ideally you should the POINT from this : https://dev.mysql.com/doc/refman/8.0/en/spatial-types.html
        But I don't think it's available on AppDrag ? I'll let them answer on that one ^^"

        Good day

        Linda MacDonald 1 Reply Last reply Reply Quote 1
        • Joseph Benguira
          Joseph Benguira last edited by

          Thanks Pierre, indeed Float & Doubles are good choices,
          Point is to be used in Spatial mode

          Indeed we don't expose Point (PT) type for now, this may be added later 😉

          In the meantime you can use "New Query" in the left menu to add your column with SQL:
          https://dev.mysql.com/doc/refman/8.0/en/creating-spatial-columns.html

          Linda MacDonald 1 Reply Last reply Reply Quote 0
          • Linda MacDonald
            Linda MacDonald @Pierre SULPICE last edited by

            @Pierre-SULPICE super duper cool thanks a mil Pierre 🙂 🙂

            1 Reply Last reply Reply Quote 0
            • Linda MacDonald
              Linda MacDonald @Joseph Benguira last edited by

              @Joseph-Benguira hey there Joseph 🙂 thank you so much for the info, would be excellent if you guys add the PT type 😉 will be looking forward

              1 Reply Last reply Reply Quote 0
              • Linda MacDonald
                Linda MacDonald last edited by

                Any chance that you Guys are considering integration options with mongodb? 😊

                1 Reply Last reply Reply Quote 0
                • Joseph Benguira
                  Joseph Benguira last edited by Joseph Benguira

                  Hey Linda,

                  maybe yes, we are thinking about it (also for Redis, MongoDB, PostgreSQL)

                  But in the meantime you can use external mongodb providers like MongoDB Atlas:
                  https://www.mongodb.com/cloud/atlas
                  https://www.mongodb.com/pricing

                  They even provide a free tier for small databases 🙂

                  you can they use it from your cloud functions with the NPM package: https://www.npmjs.com/package/mongodb

                  
                  const MongoClient = require('mongodb').MongoClient;
                  const uri = "mongodb+srv://root:<password>@XXXXXXXXX.mongodb.net/<dbname>?retryWrites=true&w=majority";
                  const client = new MongoClient(uri, { useNewUrlParser: true });
                  client.connect(err => {
                    const collection = client.db("test").collection("devices");
                    // perform actions on the collection object
                    client.close();
                  });
                  
                  
                  Linda MacDonald 1 Reply Last reply Reply Quote 0
                  • Linda MacDonald
                    Linda MacDonald @Joseph Benguira last edited by

                    @Joseph-Benguira yup atlas is cool, was just wondering if you where considering getting it into the appdrag ecosystem 🙂

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post