title: Mongoose aggregation With GraphQL returning error
body: <p>I'm working on a project and currently using Mongodb Time-Series and aggregation.
  I connected my Apollo Graphql to retrieve the data but i'm stuck with an error that i can not solve no matter what.</p>
  <p>Float cannot represent non numeric value:</p>
  <p>On my db the numbers are saved as Double. If i try to run the query in MongoDB Aggregation with MongoDBCompass it's working perfectly but not on my Nodejs database.</p>
  <p>I tried googling my problem first and looking ad docs but all the different solution i found do not solve my problem, any suggestions?</p>
  <p>This is my Query:</p>
  <pre><code>module.exports = async (root, { limit }, { models }) =&gt; {
  
    const keyx = await models.Weather.aggregate([
      {
        $group: {
          _id: {
            yearMonthDay: {
              $dateToString: { format: &quot;%Y-%m-%d&quot;, date: &quot;$timestamp&quot; },
            },
          },
          temp: {
            $push: { temp: &quot;$temp&quot; },
          },
        },
      },
    ])
      .exec();
  
    return keyx;
  };
  </code></pre>
  <p>This is my model:</p>
  <pre><code>const mongoose = require(&quot;mongoose&quot;);
  
  const { Schema } = mongoose;
  mongoose.pluralize(null);
  
  const weather = new Schema({
    timestamp: {
      type: String,
      trim: true,
    },
    temp: {
      type: Number,
      trim: true,
    },
   
  });
  
  const Weather = mongoose.model(&quot;time_weather&quot;, weather);
  module.exports = { Weather };
  </code></pre>
  <p>and this is my types:</p>
  <pre><code>const { gql } = require(&quot;apollo-server&quot;);
  
  module.exports = gql`
    type Weather {
      timestamp: String
      _id: ID
      temp: Float
      
    }
  
    type Query {
      weather(limit: Int): [Weather]
    }
  `;
  </code></pre>
  <p>and finally this is the response i'm getting from apollo studio:</p>
  <pre><code>{
    &quot;errors&quot;: [
      {
        &quot;message&quot;: &quot;Float cannot represent non numeric value: [{ temp: 11.7 }, { temp: 11.7 }, { temp: 12.01 }, { temp: 13.21 }, { temp: 13.21 }, { temp: 11.93 }, { temp: 13.21 }, { temp: 12.73 }, { temp: 14.21 }, { temp: 11.7 }, ... 14 more items]&quot;,
        &quot;locations&quot;: [
          {
            &quot;line&quot;: 6,
            &quot;column&quot;: 5
          }
        ],
        &quot;path&quot;: [
          &quot;weather&quot;,
          0,
          &quot;temp&quot;
        ],
        
        }
      },
  </code></pre>