title: How to get the value of a field from mongoDB using mongoose through javascript
body: <p>This is a document under the collection <strong>users</strong> in my database <strong>newDb</strong>,</p>
  
  <pre><code>&gt; db.users.find().pretty()
  {
          "_id" : ObjectId("57025801593e301831ef3c72"),
          "country" : "U.S",
          "gender" : "Male",
          "lastName" : "Ks",
          "firstName" : "Balajee",
          "password" : "$2a$08$.Qts1uaOJiyH.A0LM9QeGOB1EBfItB2nV29RxLVbloDnzAggIuGf6",
          "email" : "balajee41@gmail.com",
          "position" : [
                  "1",
                  "2"
          ],
          "__v" : 1,
          "operation" : "add",
          "userip" : "11"}
  </code></pre>
  
  <p>How can I fetch <strong>position,operation and userip</strong> from this document and use it for executing a function?
  This is a function in a separate Javascript file apart form the main node file.</p>
  
  <pre><code>function verifyOTP() {
      var position = user.position;
      var operation = user.operation;
      var useripp = user.userip;
      check(arr, position, operation, useripp);
  }
  </code></pre>