express js request problem, pass multiple values/collection for a query keyHow to include route handlers in multiple files in Express?Get hostname of current request in node.js ExpressHTTP GET Request in Node.js Expressnode + express + mongoose query authentificationHow to loop over mongodb array with express and monk to create a page for each element?NodeJS + MongoDB + Express - Query not bringing any resultsSorting CouchDB result by valueREDIS - creating meaningful keys to reduce queriesDoing a proper MongoDB Query (TypeError: Converting circular structure to JSON)How to use $or operator in URL query string for node.js express mongoose backend
Improving Sati-Sampajañña (situative wisdom)
When quoting someone, is it proper to change "gotta" to "got to" without modifying the rest of the quote?
Two researchers want to work on the same extension to my paper. Who to help?
Company stopped paying my salary. What are my options?
Why does increasing the sampling rate make implementing an anti-aliasing filter easier?
Why use steam instead of just hot air?
spatiotemporal regression
Can a surprised creature fall prone voluntarily on their turn?
Has there been evidence of any other gods?
How to rename pi as another value only for y axis without affecting pi used in x axis?
What does this quote in Small Gods refer to?
Best species to breed to intelligence
Succinct and gender-neutral Russian word for "writer"
Why do the Avengers care about returning these items in Endgame?
Exception propagation
Program for finding longest run of zeros from a list of 100 random integers which are either 0 or 1
Removing all characters except digits from clipboard
I might have messed up in the 'Future Work' section of my thesis
Does the 500 feet falling cap apply per fall, or per turn?
What's the "magic similar to the Knock spell" referenced in the Dungeon of the Mad Mage adventure?
Windows OS quantum vs. SQL OS Quantum
Remove color cast in darktable?
Names of the Six Tastes
What is the criteria of choosing a given pin pattern in ICs?
express js request problem, pass multiple values/collection for a query key
How to include route handlers in multiple files in Express?Get hostname of current request in node.js ExpressHTTP GET Request in Node.js Expressnode + express + mongoose query authentificationHow to loop over mongodb array with express and monk to create a page for each element?NodeJS + MongoDB + Express - Query not bringing any resultsSorting CouchDB result by valueREDIS - creating meaningful keys to reduce queriesDoing a proper MongoDB Query (TypeError: Converting circular structure to JSON)How to use $or operator in URL query string for node.js express mongoose backend
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I need to pass multiple values i.e a collection for a particular query key in express.
My memory might be tricking me, but I am inclined to believe that I have seen something like this somewhere on the web:
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
I know that Ruby on Rails returns these querystring values as an array but I thought express had some similar querystring behaviour but I can't find it in their documentation.
Have I missed something?
node.js express
add a comment |
I need to pass multiple values i.e a collection for a particular query key in express.
My memory might be tricking me, but I am inclined to believe that I have seen something like this somewhere on the web:
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
I know that Ruby on Rails returns these querystring values as an array but I thought express had some similar querystring behaviour but I can't find it in their documentation.
Have I missed something?
node.js express
add a comment |
I need to pass multiple values i.e a collection for a particular query key in express.
My memory might be tricking me, but I am inclined to believe that I have seen something like this somewhere on the web:
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
I know that Ruby on Rails returns these querystring values as an array but I thought express had some similar querystring behaviour but I can't find it in their documentation.
Have I missed something?
node.js express
I need to pass multiple values i.e a collection for a particular query key in express.
My memory might be tricking me, but I am inclined to believe that I have seen something like this somewhere on the web:
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
I know that Ruby on Rails returns these querystring values as an array but I thought express had some similar querystring behaviour but I can't find it in their documentation.
Have I missed something?
node.js express
node.js express
edited Mar 23 at 9:40
asdfg_rocks
767
767
asked Mar 23 at 9:24
LongHikeLongHike
8341225
8341225
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Meanwhile I've found out that it actually works with express.
This querystring
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
is being parsed into an array by express js. Thus
req.query.id => ["10","11","12"]
This should be mentioned in the express documentation.
In fact express makes use of a package named 'qs', which is worth taking a closer look at:
https://github.com/ljharb/qs
It even does deep nesting like
http://<somehost>/<somepath>?persona[country][birth]=us&person[country][resident]=de
which is being parsed into
person: country: birth: 'us', resident: 'de'
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312311%2fexpress-js-request-problem-pass-multiple-values-collection-for-a-query-key%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Meanwhile I've found out that it actually works with express.
This querystring
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
is being parsed into an array by express js. Thus
req.query.id => ["10","11","12"]
This should be mentioned in the express documentation.
In fact express makes use of a package named 'qs', which is worth taking a closer look at:
https://github.com/ljharb/qs
It even does deep nesting like
http://<somehost>/<somepath>?persona[country][birth]=us&person[country][resident]=de
which is being parsed into
person: country: birth: 'us', resident: 'de'
add a comment |
Meanwhile I've found out that it actually works with express.
This querystring
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
is being parsed into an array by express js. Thus
req.query.id => ["10","11","12"]
This should be mentioned in the express documentation.
In fact express makes use of a package named 'qs', which is worth taking a closer look at:
https://github.com/ljharb/qs
It even does deep nesting like
http://<somehost>/<somepath>?persona[country][birth]=us&person[country][resident]=de
which is being parsed into
person: country: birth: 'us', resident: 'de'
add a comment |
Meanwhile I've found out that it actually works with express.
This querystring
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
is being parsed into an array by express js. Thus
req.query.id => ["10","11","12"]
This should be mentioned in the express documentation.
In fact express makes use of a package named 'qs', which is worth taking a closer look at:
https://github.com/ljharb/qs
It even does deep nesting like
http://<somehost>/<somepath>?persona[country][birth]=us&person[country][resident]=de
which is being parsed into
person: country: birth: 'us', resident: 'de'
Meanwhile I've found out that it actually works with express.
This querystring
http://<somehost>/<somepath>?id[]=10&id[]=11&id[]=12
is being parsed into an array by express js. Thus
req.query.id => ["10","11","12"]
This should be mentioned in the express documentation.
In fact express makes use of a package named 'qs', which is worth taking a closer look at:
https://github.com/ljharb/qs
It even does deep nesting like
http://<somehost>/<somepath>?persona[country][birth]=us&person[country][resident]=de
which is being parsed into
person: country: birth: 'us', resident: 'de'
edited Mar 24 at 5:18
answered Mar 23 at 10:36
LongHikeLongHike
8341225
8341225
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55312311%2fexpress-js-request-problem-pass-multiple-values-collection-for-a-query-key%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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