title: react js mongodb query issue
body: <p>i'm having an issue querying my mongodb database. i'm using react js. the problem doesn't seem to be the connection because i can save to the database just fine, i can only assume its a syntax issue. i've looked around but couldn't find a fix. below is a snippet of code from the schema.js file and the index.js file:</p>
  
  <p>Schema.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//import dependency
  var mongoose = require('mongoose')
  var Schema = mongoose.Schema
  //create new instance of the mongoose.schema. the schema takes an
  //object that shows the shape of your database entries.
  var UserSchema = new Schema({
   socketId: String
  })
  //export our module to use in server.js
  module.exports = mongoose.model('User', UserSchema)</code></pre>
  </div>
  </div>
  </p>
  
  <p>index.js</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var mongoose = require('mongoose')
  var db = mongoose.connect('mongodb://mongodatabase', {
    useMongoClient: true,
    /* other options */
  })
  var UserSchema = require('../schema/Schemas');</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function userExist(userList, username){
      var usert = new UserSchema()
      var query = usert.where({socketId: username})
      query.findOne(function (err, usert) {
        if (err) return handleError(err);
        if (usert) {
          // doc may be null if no document matched
        }
      });
     return username in userList
      // return query
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I get the error : usert.where is not a function. 
  i tried using just find but i get the same error</p>
  
  <p>any help would be welcome, Thank you</p>