I want to use mongodb.js in a react created app as the code below.
componentWillMount() {
MongoClient.connect(uri, function (err, db) {
db.collection('events').find().toArray(function (err, data) {
console.log({ data });
});
});
}
But the error occurs, said that "qs.unescape is not a function" , but I found the source and found out that it is a function, so how can this message occur?
TypeError: qs.unescape is not a function
Screenshot for the error message
const qs = require('querystring');