title: Why does the spread operator nest data in another object?
body: <p>I have been working with mongoose. And To find a user by their Email I returned a mongoose Promise like this:</p>
  
  <pre><code>async function findByEmail({ email }) {
      return await userModel.findOne({ email }).exec()
  }
  </code></pre>
  
  <p>This is when things get a little bit weird, When I want to return the user using the Spread operator of Javascript</p>
  
  <pre><code>const user1 = await findByEmail({email: a@a.a});
  const user2 = {...user1};
  console.log('user1',user1);
  console.log('user2',user2);
  </code></pre>
  
  <p>User1 is like this:</p>
  
  <pre><code>{
  "_id": "ck09o6bvq0000zxsv6vr57oll",
  "name": "bobo",
  "email": "a@a.a",
  "password": "$2b$10$1zQd/3Sw6zJi9N42zGLaT.Re5tnbt.ANzZ1XoGA0LLWFpjc05ef.a",
  "facebookId": null,
  "googleId": null,
  "createdOn": 1567868083622,
  "approved": true,
  "__v": 0
  }
  </code></pre>
  
  <p>While User2 is like this:</p>
  
  <pre><code>"$__": {
    "strictMode": true,
    "selected": {},
    "getters": {},
    "_id": "ck09o6bvq0000zxsv6vr57oll",
    "wasPopulated": false,
    "activePaths": {
      "paths": {
        "approved": "init",
        "createdOn": "init",
        "password": "init",
        "email": "init",
        "name": "init",
        "_id": "init",
        "facebookId": "init",
        "googleId": "init",
        "__v": "init"
      },
      "states": {
        "ignore": {},
        "default": {},
        "init": {
          "_id": true,
          "name": true,
          "email": true,
          "password": true,
          "facebookId": true,
          "googleId": true,
          "createdOn": true,
          "approved": true,
          "__v": true
        },
        "modify": {},
        "require": {}
      },
      "stateNames": [
        "require",
        "modify",
        "init",
        "default",
        "ignore"
      ]
    },
    "pathsToScopes": {},
    "cachedRequired": {},
    "$setCalled": {},
    "emitter": {
      "domain": null,
      "_events": {},
      "_eventsCount": 0,
      "_maxListeners": 0
    },
    "$options": {
      "skipId": true,
      "isNew": false,
      "willInit": true
    }
  },
  "isNew": false,
  "_doc": {
    "_id": "ck09o6bvq0000zxsv6vr57oll",
    "name": "bobo",
    "email": "a@a.a",
    "password": "$2b$10$1zQd/3Sw6zJi9N42zGLaT.Re5tnbt.ANzZ1XoGA0LLWFpjc05ef.a",
    "facebookId": null,
    "googleId": null,
    "createdOn": 1567868083622,
    "approved": true,
    "__v": 0
  },
  "$locals": {},
  "$init": true
  }
  </code></pre>
  
  <p>which is Actually a Mongoose wrapper.
  Can Someone Please tell me why is this happening? And Why user1 is not the same as user2? </p>