0

I have data in rethinkdb as following: enter image description here

but now when I do this:

await axios.post(config.baseURL + '/save-menu', {
  filename: rawConfigs[0].repoSettings[0].BaseURL + '/public/log.md' ,
  text:JSON.stringify(job.log),
  type: 'file'
  }).catch((e) => {
   console.log(e)
  )

The result is stored as this: enter image description here

I want it as pretty as it looks in rethinkdb.

5
  • possible duplicate of stackoverflow.com/a/5670892/3461055 Commented May 10, 2018 at 10:59
  • Can you paste your JSON data as text instead of screenshot? Commented May 10, 2018 at 11:02
  • @ArifKhan no its different because stringify does'nt work for me. Commented May 10, 2018 at 11:02
  • 1
    You need to use text: JSON.stringify(job.log, null, 4) , check JSON.stringify Commented May 10, 2018 at 11:06
  • TY @ArifKhan text: JSON.stringify(job.log, null, 4) worked as well the pacakge json-format Commented May 10, 2018 at 11:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.