No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Using MongoDB in Quasar

    Framework
    api models mongo
    5
    6
    1124
    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.
    • N
      NickBloodworth last edited by

      Hi,
      I’m following a Vue.JS course on Udemy and it is using MongoDB as the database which is fine.
      It then goes through creating models and controllers, and I was wondering two things:

      Can we use the Mongo Cloud database in Quasar, and can we also use the models/controllers in Quasar to fetch and view the data using API’s? I have followed Danny Connells course, and it doesn’t mention any of this.

      I know Quasar is built on top of Vue, but I was just curious. I am doing this course The Complete Vue JS Developer Course – inc. Vue JS 2! if that helps

      Thanks,
      Nick

      T 1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel last edited by dobbel

        I think Danny really likes Firebase :-). With Firebase you can directly make requests from quasar( or any js) to access Firebase data without a server in between. With Mongo Cloud database on the other hand you need a (nodejs) server in between Quasar and Mongodb ( correct me if I am wrong).

        btw I am using a Meteor.js as a server to deliver data from MongoDB to my Quasar apps.

        1 Reply Last reply Reply Quote 0
        • N
          NickBloodworth last edited by

          Documentation on referencing other data is scarce. How do I create a relationship between data objects? Are there any good tutorials for Firebase?

          1 Reply Last reply Reply Quote 0
          • s.molinari
            s.molinari last edited by

            Documentation on referencing other data is scarce.

            Say woot?!? There is tons of documentation out there. Just not so much specific to Quasar, but it is also “just Vue” or even “just SPA/ PWA” or “just Electron” or, well you get the gist and thus, there is a ton of it out there. 🙂

            Scott

            1 Reply Last reply Reply Quote 0
            • T
              tunchamroeun @NickBloodworth last edited by tunchamroeun

              @NickBloodworth I fact Vue.JS or Quasar , we use them as UI framework. If you want to communicate with backend you need a backend languages like php ,nodejs … . If you want to use Mongodb Cloud as your database you can use (nodejs express mongoose) to build API as my recommendation. If you want to move from local to Cloud just change the connection string. Hope it help

              1 Reply Last reply Reply Quote 0
              • necmettin
                necmettin last edited by

                VueJS cannot use MongoDB directly. VueJS is a frontend library (works in the browser), while MongoDB is a server-side database technology. In the course you mentioned, the author is probably bridging VueJS and MongoDB through an ExpressJS app, which runs in a server. You should be seeing things like fetch( or axios in the examples. Those words indicate the client-side application connecting to a backend.

                The models are probably written for a MongoDB library that runs in ExpressJS. Controllers must be either self-developed or using a library that allows creating controllers for ExpressJS.

                Notice I keep saying ExpressJS. There are other server frameworks for NodeJS, but ExpressJS is the most popular one.

                Also, the only difference between running your own MongoDB instance and using MongoDB atlas (for the ExpressJS app) is where to connect. One connects to MongoDB running on http://localhost, the other connects to something like https://srv05-nickb.atlas.mongodb.com

                Long story short, yes, you can use MongoDB with Vue or Quasar. But it won’t be Vue or Quasar using / connecting to MongoDB but an intermediary app written in something like ExpressJS.

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