Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
axios copy data from one collection or api to another

I would like to know if there is a better way to copy data from an api collection to another.Basically I would like to get data from one collection and post it in another collection

I am looking for a better way to do it than I correctly doing

get from collection A

{
    "_id": {
        "$oid": "614d3cedfb2600340fdb28f9"
    },
    "date": "2021-09-23",
    "title": "First test",
    "description": "Going",
    
}

I like to post in collection b

return await axios
    .get(url.rest_api + '/template', {
      params: {
        owner: 'abc123',
      },
    })
    .then(response => {
        axios
        .post(url.rest_api + '/todos', response.data)
        .then(function (response) {
            console.log(response)
        })
        .catch(function (error) {
            // handle error
            console.warn(error.message);
            })
    })
    .catch(err => {
      console.log(err);
    });

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!