2
[{ '$__':
     InternalCache {
       strictMode: true,
       selected: {},
       shardval: undefined,
       saveError: undefined,
       validationError: undefined,
       adhocPaths: undefined,
       removing: undefined,
       inserting: undefined,
       version: undefined,
       getters: {},
       _id: 5bdff2078562732cf4820ba8,
       populate: undefined,
       populated: undefined,
       wasPopulated: false,
       scope: undefined,
       activePaths: [Object],
       pathsToScopes: {},
       session: undefined,
       ownerDocument: undefined,
       fullPath: undefined,
       emitter: [Object],
       '$options': [Object] },
    isNew: false,
    errors: undefined,
    _doc:
     { flag: [],
       user: [],
       createdate: 2018-11-05T07:32:23.825Z,
       __v: 0 },
    '$init': true,
    parent_username: '',
    flag: [] } ]

I have a dataset like this:

         { flag: [],
           user: [],
           createdate: 2018-11-05T07:32:23.825Z,
           __v: 0 }

Now I add some key on dataset

{
 flag: [],
 user: [],
 createdate: 2018-11-05T07:32:23.825Z,
 parent_username: '',
 flag: []
 __v: 0
}

But I am getting extra response. Any Idea why this is happening. This may be of mongodb or node or javascript issue. Any suggestion is really appreciated.

Ankit
  • 951
  • 1
  • 9
  • 29
  • Look for `_doc` in your object above. It does not have any extra keys. That can be your starting point. – Nikhil Aggarwal Nov 13 '18 at 09:46
  • The code is returning a [`Query`](https://mongoosejs.com/docs/api.html#Query) or `Promise` ( more likely the former ) object, not the results. Typically you missed an `exec()` call or `await`, or indeed a "callback". Of course you did not actually "show the code" producing this in your question. And that's kind of a vital thing to include when asking such a question of your peers. – Neil Lunn Nov 13 '18 at 09:52

0 Answers0