Express extended query parser
Express has simple and extended query parsers. simple
is based on Node’s queryparser and extended
is based on qs
However, if we need to override the default options of qs
, we could do as below,
const express = require('express');
const qs = require('qs');
const app = express();
app.set('query parser', (str) => qs.parse(str, { arrayLimit: 100 }));
...
This will use qs
as the default query parser & override its default arrayLimit
size from 20 to 100.