title: MongoDB find() giving wrong object?
body: <p>I am running a mongo query from the <code>Order</code> database which aims to fetch the orders of a particular user by using his email-id. This is done using an API, but I am getting the complete object with some unnecessary details.</p>
  <h3>Code</h3>
  <p>I have written the following API in nextJS name <code>myorders</code></p>
  <pre><code>import Order from &quot;../../models/Order&quot;;
  import connectDB from &quot;../../middleware/mongoose&quot;;
  import jsonwebtoken from &quot;jsonwebtoken&quot;;
  
  const handler = async(req, res) =&gt; {
      const token = req.body.token;
      const data = jsonwebtoken.verify(token,process.env.JWT_SECRET);
      console.log(data)
      let mere_orders = Order.find({email: data.email})
      console.log(&quot;mereorders12 = &quot;, mere_orders)
      res.status(200).json({mere_orders});
    }
    
  
  export default connectDB(handler);
  </code></pre>
  <p>And <code>console.log(&quot;mereorders12 = &quot;, mere_orders)</code> gives me this</p>
  <pre><code>mereorders12 =  Query {
    _mongooseOptions: {},
    _transforms: [],
    _hooks: Kareem { _pres: Map(0) {}, _posts: Map(0) {} },
    _executionStack: null,
    mongooseCollection: Collection {
      collection: Collection { s: [Object] },
      Promise: [Function: Promise],
      modelName: 'Order',
      _closed: false,
      opts: {
        autoIndex: true,
        autoCreate: true,
        schemaUserProvidedOptions: [Object],
        capped: false,
        Promise: [Function: Promise],
        '$wasForceClosed': undefined
      },
      name: 'orders',
      collectionName: 'orders',
      conn: NativeConnection {
        base: [Mongoose],
        collections: [Object],
        models: [Object],
        config: {},
        replica: false,
        options: null,
        otherDbs: [],
        relatedDbs: {},
        states: [Object: null prototype],
        _readyState: 1,
        _closeCalled: undefined,
        _hasOpened: true,
        plugins: [],
        id: 0,
        _queue: [],
        _listening: false,
        _connectionString: 'mongodb://localhost:27017/chesswear',
        _connectionOptions: [Object],
        client: [MongoClient],
        '$initialConnection': [Promise],
        db: [Db],
        host: 'localhost',
        port: 27017,
        name: 'chesswear'
      },
      queue: [],
      buffer: false,
      emitter: EventEmitter {
        _events: [Object: null prototype] {},
        _eventsCount: 0,
        _maxListeners: undefined,
        [Symbol(kCapture)]: false
      }
    },
    model: Model { Order },
    schema: Schema {
      obj: {
        email: [Object],
        orderId: [Object],
        paymentInfo: [Object],
        products: [Object],
        address: [Object],
        subtotal: [Object],
        status: [Object]
      },
      paths: {
        email: [SchemaString],
        orderId: [SchemaString],
        paymentInfo: [SchemaString],
        products: [Mixed],
        address: [SchemaString],
        subtotal: [SchemaNumber],
        status: [SchemaString],
        _id: [ObjectId],
        updatedAt: [SchemaDate],
        createdAt: [SchemaDate],
        __v: [SchemaNumber]
      },
      aliases: {},
      subpaths: {},
      virtuals: { id: [VirtualType] },
      singleNestedPaths: {},
      nested: {},
      inherits: {},
      callQueue: [],
      _indexes: [],
      methods: { initializeTimestamps: [Function (anonymous)] },
      methodOptions: {},
      statics: {},
      tree: {
        email: [Object],
        orderId: [Object],
        paymentInfo: [Object],
        products: [Object],
        address: [Object],
        subtotal: [Object],
        status: [Object],
        _id: [Object],
        updatedAt: [Function: Date],
        createdAt: [Object],
        __v: [Function: Number],
        id: [VirtualType]
      },
      query: {},
      childSchemas: [],
      plugins: [ [Object], [Object], [Object], [Object], [Object] ],
      '$id': 1,
      mapPaths: [],
      s: { hooks: [Kareem] },
      _userProvidedOptions: { timestamps: true },
      options: {
        timestamps: true,
        typeKey: 'type',
        id: true,
        _id: true,
        validateBeforeSave: true,
        read: null,
        shardKey: null,
        discriminatorKey: '__t',
        autoIndex: null,
        minimize: true,
        optimisticConcurrency: false,
        versionKey: '__v',
        capped: false,
        bufferCommands: true,
        strictQuery: true,
        strict: true,
        pluralization: true
      },
      '$timestamps': { createdAt: 'createdAt', updatedAt: 'updatedAt' },
      '$globalPluginsApplied': true,
      _requiredpaths: [ 'status', 'subtotal', 'address', 'products', 'orderId', 'email' ]
    },
    op: 'find',
    options: {},
    _conditions: { email: 'mohit6@test.com' },
    _fields: undefined,
    _update: undefined,
    _path: undefined,
    _distinct: undefined,
    _collection: NodeCollection {
      collection: Collection {
        collection: [Collection],
        Promise: [Function: Promise],
        modelName: 'Order',
        _closed: false,
        opts: [Object],
        name: 'orders',
        collectionName: 'orders',
        conn: [NativeConnection],
        queue: [],
        buffer: false,
        emitter: [EventEmitter]
      },
      collectionName: 'orders'
    },
    _traceFunction: undefined,
    '$useProjection': true
  }
  </code></pre>
  <p>But I should return order like this</p>
  <pre><code>{  
   orders: [
   { 
   
   &quot;_id&quot;:&quot;62693ae3f7fd0b7d87c8eb9c&quot;},
   &quot;email&quot;:&quot;mohit3@test.com&quot;,
   &quot;orderId&quot;:&quot;1389629752594&quot;,
   &quot;paymentInfo&quot;:&quot;No payment info&quot;,
   &quot;products&quot;:{...},
   &quot;address&quot;:&quot;adasdklfasflka&quot;,
   &quot;subtotal&quot;:4,
   &quot;status&quot;:&quot;Paid&quot;,
   &quot;createdAt&quot;:{&quot;$date&quot;:&quot;2022-04-27T12:45:23.352Z&quot;},
   &quot;updatedAt&quot;:{&quot;$date&quot;:&quot;2022-04-27T12:45:23.352Z&quot;},&quot;__v&quot;:0
  
  }
  ,
   { 
   
   &quot;_id&quot;:&quot;62693ae3f7fd0b7d87c8eb9c&quot;},
   &quot;email&quot;:&quot;mohit3@test.com&quot;,
   &quot;orderId&quot;:&quot;1389629752594&quot;,
   &quot;paymentInfo&quot;:&quot;No payment info&quot;,
   &quot;products&quot;:{...},
   &quot;address&quot;:&quot;adasdklfasflka&quot;,
   &quot;subtotal&quot;:14,
   &quot;status&quot;:&quot;Paid&quot;,
   &quot;createdAt&quot;:{&quot;$date&quot;:&quot;2022-04-27T12:45:23.352Z&quot;},
   &quot;updatedAt&quot;:{&quot;$date&quot;:&quot;2022-04-27T12:45:23.352Z&quot;},&quot;__v&quot;:0
  
  }
  
  ]
  
  }
  </code></pre>
  <p>Additionally this is the model schema of <code>Order</code></p>
  <pre><code>const mongoose = require(&quot;mongoose&quot;);
  
  const OrderSchema = new mongoose.Schema(
    {
      email: { type: String, required: true },
      orderId: { type: String, required: true },
      paymentInfo: { type: String, default: &quot;No payment info&quot; },
      products: { type: Object, required: true },
      address: { type: String, required: true },
      subtotal: { type: Number, required: true },
      status: { type: String, required: true, default: &quot;Pending&quot; },
    },
    { timestamps: true }
  );
  
  export default mongoose.models.Order || mongoose.model(&quot;Order&quot;, OrderSchema);
  </code></pre>
  <p>Please help ??</p>