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

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived