title: Calling mongoose from react client side
body: <p>Yes, I know I should call it from server side. But the purpose is to invoke MongoDB strait from the react-redux app. It's like firebase serverless apps do.
  I write</p>
  
  <pre><code>    import mongoose from 'mongoose';
  
      let mongoDB = 'mongodb://127.0.0.1/my_database';
      mongoose.connect(mongoDB);
  
      mongoose.Promise = global.Promise;
  
      let db = mongoose.connection;
      db.on('error', console.error.bind(console, 'MongoDB connection error:'));
  </code></pre>
  
  <p>And I get:</p>
  
  <pre><code>TypeError: __ 
  WEBPACK_IMPORTED_MODULE_6_mongoose___default.a.connect is not a function
  </code></pre>
  
  <p>How to solve this problem?</p>