I'm using RavenDB within C# Asp.Net, and I'm having trouble with applying an OrderBy which orders by a value within a sub collection. A basic example of my model is:

```
public class Record
{
    public string Id { get; set; }

    public string Name {get; set; }

    public Field[] Fields { get; set; }
}

public class Field
{
    public string Name { get; set; }

    public string Value { get; set; }
}

```

This saves down into RavenDB like so

```
{
   "Name": "A Name Of Somesort"
   "Fields": [
       {
          "Name": "Colour",
          "Value": "Red"
       },
       {
          "Name": "Size",
          "Value": "Large"
       }
   ]
}

```

Imagining a large amount of these Records saved into the db, I can get a page of this data like so

```
using (var session = documentStore.OpenSession("TestDB"))
{
    var result = session.Query<Record>().Skip(0).Take(10).ToList();
}

```

What I'd like to do is to be able to sort the records based on a Field value (for example: sort the Records on the Value of a Field whose name is 'Colour')

**Edit:**

To help explain further, what Im wanting to achieve is something like below, however this is not allowed in RavenDB so i need to find an alternative way of doing it (if its even possible)

```
using (var session = documentStore.OpenSession("TestDB"))
{
    var result = session.Query<Record>()
                .OrderBy(v => v.Fields.First(f => f.Name == "Colour").Value)
                .Skip(0)
                .Take(10)
                .ToList();
}

```

This throws a new ArgumentException with the following message

```
Invalid computation: v.Fields.First(f => (f.Name == "Colour")).Value. You cannot use computation (only simple member expression are allowed) in RavenDB queries.

```