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;








1















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?










share|improve this question






























    1















    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?










    share|improve this question


























      1












      1








      1








      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 9:40









      asdfg_rocks

      767




      767










      asked Mar 23 at 9:24









      LongHikeLongHike

      8341225




      8341225






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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' 





          share|improve this answer

























            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%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









            0














            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' 





            share|improve this answer





























              0














              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' 





              share|improve this answer



























                0












                0








                0







                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' 





                share|improve this answer















                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' 






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 24 at 5:18

























                answered Mar 23 at 10:36









                LongHikeLongHike

                8341225




                8341225





























                    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%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





















































                    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

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해