Issue of mongodb.js (TypeError: qs.unescape is not a function) occurs in React app, but the function can be found

Viewed 407

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');

Screenshot for the Source Code of qs

0 Answers
Related