0

Do I need a server to use a mongoDB database?

Can I post data by just using axios?

axios
        .post(`https://lq-time-tracking.firebaseio.com/user.json`, values)
        .then(function(response) {})
        .catch(function(error) {
          console.log(error);
        });

I would like to use mongodb instead of firebase...

rstowe1
  • 71
  • 1
  • 4
  • 14

1 Answers1

1

You cannot directly post data to a MongoDB. You need to create a server which will perform operations on a MongoDB (or any other DB) for you. If you are a Javascript guy then a recommended setup for you would be to have a Node JS Server with mongoose dependency. Inside this server you need to write your logic for saving your data. Let me know if you need a boiler plate for this.

Ayyub Kolsawala
  • 809
  • 8
  • 15
  • I have created the server, but now I am getting a new error, you can see the question as follows: https://stackoverflow.com/questions/59012908/posting-to-mongodb – rstowe1 Nov 23 '19 at 22:36