title: RESTHeart filtering and sorting by sub documents property
body: <p>I m working with mongodb and restheart. </p>
  
  <p>In my nosql db i have a unique document with this structure:</p>
  
  <pre><code>{
  "_id": "docID",
  "users": [
              {
               "userID": "12",                 
               "elements": [
                             {
                              "elementID": "1492446877599",
                               "events": [
                                           {
                                            "id": 1,
                                            "date": 356
                                           },   
                                           {                                       
                                             "id": 2,
                                             "date": 123
                                            }
                                         ]
                              }
                          ]
                 },
                {
                  "userID": "11",                 
                  "elements": [
                                {
                                  "elementID": "14924",
                                  "events": [
                                             {
                                              "id": 1,
                                              "date": 123
                                              },   
                                              {                                       
                                               "id": 2,
                                               "date": 356
                                               }
                                             ]
                                 },
                                 {
                                  "elementID": "14925",
                                  "events": [
                                             {
                                              "id": 1,
                                              "date": 12
                                              },   
                                              {                                       
                                               "id": 2,
                                               "date": 36
                                               }
                                             ]
                                 }
                           ]  
                }
  </code></pre>
  
  <p>i need to filter the user with userID = 11 and i need to order his events by ascending date.</p>
  
  <p>i was trying with:</p>
  
  <p><a href="http://myhost:port/myCollection?keys=" rel="nofollow noreferrer">http://myhost:port/myCollection?keys=</a>{"users":{"$elemMatch":{"userID":"11"}}}&amp;sort_by={"users.elements.events.date":-1}</p>
  
  <p>but it doesn t work.</p>