question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Get parameter position

See original GitHub issue

While you can retrieve GET parameters using req.query I’m not familiar with a method to retrieve a parameter’s position.

Let me clarify the use case: I’m building a server that filters a database by given filter parameters, in the same order they are passed. Therefore I need to determine the arrangement of filter parameters.

You probably wouldn’t like to add the position directly to the parameter, e.g. req.query.x.pos. Therefore my idea is to have a separate array with the positions, e.g. req.queryPosition.x.

Example:

/?test1=true&test2=false

req.queryPosition.test1
// => 0

req.queryPosition.test2
// => 1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
wesleytoddcommented, Nov 21, 2016

To me this seems like something a third party library should do, not express core. You have direct access to the full url already, so parsing the querystring in this way should be simple.

0reactions
dougwilsoncommented, Jan 21, 2017

I’m going to close this because it seems like the conversation has stalled, with no follow up on the questions to move forward.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get "GET" request parameters in JavaScript? [duplicate]
just call the function with GET variable name as parameter, eg. get('foo'); ... function getRequests() { var s1 = location.search.substring(1, ...
Read more >
Request Parameters in Postman - Tools QA
The server reads the Request parameter from the URL and sends a Response based on the Request Parameter. In our example, Bing will...
Read more >
[Feature Request] Support url parameters without router ...
It's only possible to use parameters if they're route parameters. For example, to access name and age, a route must be set up...
Read more >
about Functions Advanced Parameters - PowerShell
The Position argument determines whether the parameter name is required when the parameter is used in a command. When a parameter declaration ...
Read more >
How to Get URL Parameters with JavaScript - SitePoint
Learn how to parse query string parameters and get their values in JavaScript. Use the results for tracking referrals, autocomplete, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found