title: How to use MongoTemplate to realize a query for a collection element with a specified subscript
body: <p>this is my SQL code ,how to use MongoTemplate to realize it！I neet to query the element from point,and output the list I need.</p>
  <pre><code>db.temperatureAndPic.aggregate([
  {
      $match : {
          number : &quot;3&quot;,
          insertDate : {
              $gte:ISODate(&quot;2021-11-22T11:10:00Z&quot;),
              $lt:ISODate(&quot;2021-11-22T12:09:59Z&quot;)
          }
      }
  },
  {
      $project : {
          number : 1,
          insertDate : 1,
          temperature : {
              $map : {
                  input : [0,200,400,500,600],
                  as : &quot;index&quot;,
                  in : {
                      $arrayElemAt : [&quot;$temperature&quot;, &quot;$$index&quot;]
                  }
              }
          }
      }
  },
  {
      $sort : {
          insertDate:1
      }
  }
  </code></pre>
  <p>]);</p>