Json with array field is convert to object (nodejs)2019 Community Moderator ElectionConvert JS object to JSON stringHow to parse JSON using Node.js?How can I update NodeJS and NPM to the next versions?map function for objects (instead of arrays)When is this JSON structure getting converted to all strings?npm WARN package.json: No repository fieldProper way to return JSON using node or ExpressProper way to set response status and JSON content in a REST API made with nodejs and expressJavascript/Json : Object of object converted to associative arrayArrays in AJAX request JSON object data

Should I be concerned about student access to a test bank?

What (if any) is the reason to buy in small local stores?

Recruiter wants very extensive technical details about all of my previous work

Do US professors/group leaders only get a salary, but no group budget?

Optimising a list searching algorithm

What is the English word for a graduation award?

두음법칙 - When did North and South diverge in pronunciation of initial ㄹ?

Asserting that Atheism and Theism are both faith based positions

I seem to dance, I am not a dancer. Who am I?

Geography in 3D perspective

What favor did Moody owe Dumbledore?

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

Violin - Can double stops be played when the strings are not next to each other?

Can other pieces capture a threatening piece and prevent a checkmate?

Why is there so much iron?

Can a wizard cast a spell during their first turn of combat if they initiated combat by releasing a readied spell?

How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?

Is it possible to stack the damage done by the Absorb Elements spell?

Turning a hard to access nut?

Calculate the frequency of characters in a string

What does Jesus mean regarding "Raca," and "you fool?" - is he contrasting them?

What is the significance behind "40 days" that often appears in the Bible?

Generic TVP tradeoffs?

HP P840 HDD RAID 5 many strange drive failures



Json with array field is convert to object (nodejs)



2019 Community Moderator ElectionConvert JS object to JSON stringHow to parse JSON using Node.js?How can I update NodeJS and NPM to the next versions?map function for objects (instead of arrays)When is this JSON structure getting converted to all strings?npm WARN package.json: No repository fieldProper way to return JSON using node or ExpressProper way to set response status and JSON content in a REST API made with nodejs and expressJavascript/Json : Object of object converted to associative arrayArrays in AJAX request JSON object data










0















I am trying to send data to my Express node server in JSON format
in my objects, but it changes it from the array to object with numbers.
For example, I send this (with my software and postman):



[
"A":["TEST1","TEST2","TEST3"],
"b":["TEST1","TEST2","TEST3"]
]


And the server shows me this as the data



[
A:0:"TEST1",1:"TEST2",2:"TEST3",
b:0:"TEST1",1:"TEST2",2:"TEST3"
]


So ["TEST1","TEST2","TEST3"] become 0:"TEST1",1:"TEST2",2:"TEST3".



So I want to know 2 things:



  1. Why it happens?

  2. How could I don't have the same API I just convert the data?









share|improve this question
























  • Show the express code

    – Anand Undavia
    Mar 7 at 17:39











  • No problem I will add code once I will be at home. p.s I am not sure it will help you becuase it look like normal code

    – Tzach Oren
    Mar 7 at 17:55
















0















I am trying to send data to my Express node server in JSON format
in my objects, but it changes it from the array to object with numbers.
For example, I send this (with my software and postman):



[
"A":["TEST1","TEST2","TEST3"],
"b":["TEST1","TEST2","TEST3"]
]


And the server shows me this as the data



[
A:0:"TEST1",1:"TEST2",2:"TEST3",
b:0:"TEST1",1:"TEST2",2:"TEST3"
]


So ["TEST1","TEST2","TEST3"] become 0:"TEST1",1:"TEST2",2:"TEST3".



So I want to know 2 things:



  1. Why it happens?

  2. How could I don't have the same API I just convert the data?









share|improve this question
























  • Show the express code

    – Anand Undavia
    Mar 7 at 17:39











  • No problem I will add code once I will be at home. p.s I am not sure it will help you becuase it look like normal code

    – Tzach Oren
    Mar 7 at 17:55














0












0








0








I am trying to send data to my Express node server in JSON format
in my objects, but it changes it from the array to object with numbers.
For example, I send this (with my software and postman):



[
"A":["TEST1","TEST2","TEST3"],
"b":["TEST1","TEST2","TEST3"]
]


And the server shows me this as the data



[
A:0:"TEST1",1:"TEST2",2:"TEST3",
b:0:"TEST1",1:"TEST2",2:"TEST3"
]


So ["TEST1","TEST2","TEST3"] become 0:"TEST1",1:"TEST2",2:"TEST3".



So I want to know 2 things:



  1. Why it happens?

  2. How could I don't have the same API I just convert the data?









share|improve this question
















I am trying to send data to my Express node server in JSON format
in my objects, but it changes it from the array to object with numbers.
For example, I send this (with my software and postman):



[
"A":["TEST1","TEST2","TEST3"],
"b":["TEST1","TEST2","TEST3"]
]


And the server shows me this as the data



[
A:0:"TEST1",1:"TEST2",2:"TEST3",
b:0:"TEST1",1:"TEST2",2:"TEST3"
]


So ["TEST1","TEST2","TEST3"] become 0:"TEST1",1:"TEST2",2:"TEST3".



So I want to know 2 things:



  1. Why it happens?

  2. How could I don't have the same API I just convert the data?






node.js express






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 19:12









Hemant Parashar

711214




711214










asked Mar 7 at 17:29









Tzach OrenTzach Oren

2910




2910












  • Show the express code

    – Anand Undavia
    Mar 7 at 17:39











  • No problem I will add code once I will be at home. p.s I am not sure it will help you becuase it look like normal code

    – Tzach Oren
    Mar 7 at 17:55


















  • Show the express code

    – Anand Undavia
    Mar 7 at 17:39











  • No problem I will add code once I will be at home. p.s I am not sure it will help you becuase it look like normal code

    – Tzach Oren
    Mar 7 at 17:55

















Show the express code

– Anand Undavia
Mar 7 at 17:39





Show the express code

– Anand Undavia
Mar 7 at 17:39













No problem I will add code once I will be at home. p.s I am not sure it will help you becuase it look like normal code

– Tzach Oren
Mar 7 at 17:55






No problem I will add code once I will be at home. p.s I am not sure it will help you becuase it look like normal code

– Tzach Oren
Mar 7 at 17:55













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049719%2fjson-with-array-field-is-convert-to-object-nodejs%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049719%2fjson-with-array-field-is-convert-to-object-nodejs%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

Zrinski family tree See also Navigation menu