Created
January 13, 2014 04:12
-
-
Save kkozmic/8394574 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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