Skip to content

Instantly share code, notes, and snippets.

@kkozmic
Created January 13, 2014 04:12
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kkozmic/8394574 to your computer and use it in GitHub Desktop.
// this works
var result = session.Query<MemberProfile>().Statistics(out stats).Skip(index).Take(200)
.Select(p => new
{
InvestorId = p.Id,
SendPushNotification = p.NotificationSubscriberIds.Any()
}).ToArray();
//this fails, with the following error message:
// Could not understand how to translate 'p.NotificationSubscriberIds.Any()' to a RavenDB query.
// Are you trying to do computation during the query?
// RavenDB doesn't allow computation during the query, computation is only allowed during index. Consider moving the operation to an index.
var result = session.Query<MemberProfile>().Statistics(out stats).Skip(index).Take(200)
.Select(p => new InvestorPushDescription
{
InvestorId = p.Id,
SendPushNotification = p.NotificationSubscriberIds.Any()
}).ToArray();
public class InvestorPushDescription
{
public string InvestorId { get; set; }
public bool SendPushNotification { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment