Answer the question
In order to leave comments, you need to log in
How to get data from db and write it to js file?
Hello. I just can’t understand and find how I can get data from a database (for example, mongodb), and write this data to a js file, namely to an array of objects. I will use this file later in an application written in React (the application is already ready). Can you suggest a sequence of actions or suggest where to find a similar solution? I will be very grateful for your help.
Answer the question
In order to leave comments, you need to log in
1. We receive using AJAX
2. We write not in JS, but in JSON. From the right place This JSON is readable.
You need to raise a simple backend:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question