This code displays true
in both Express 3 and Express 4.
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send(req.query instanceof Object);
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
So this does not seem to be a problem that is generally (or at least not universally) present in Express.
Most likely thing I can think of is that somewhere in your code (or in a library/middleware you are using), query.__proto__
is set to something that looks like an object but is not. Maybe something similar to this?:
var query = {};
query.__proto__ = null;
query.__proto__ = '{}';
console.log(query.__proto__); // {}
console.log(typeof query); // object
console.log(query instanceof Object); // false