Re: [RavenDB] SelectMany throws NotSupportedException

28 views
Skip to first unread message

Itamar Syn-Hershko

unread,
Jun 12, 2012, 5:26:49 PM6/12/12
to rav...@googlegroups.com
SelectMany is not supported on queries by design. If you want to get the _items_ from the mailbox document you will need to write an index and project out of it.

You can get the mailbox document itself rather easily by using the Any() operator within the .Where() on mailBox.Items

On Tue, Jun 12, 2012 at 10:40 PM, Gal Koren <kore...@gmail.com> wrote:
Hi.

I might be doing something wrong and I wish to know how to make it right.
This piece of code throws NotSupportedException :

                var results = session.Query<Mailbox>().
                    Where(mailBox => mailBox.Name.Equals("Gal")).
                    SelectMany(mailBox => mailBox.Items).Where(item => !item.IsDownloaded);

The story: A MailBox has Items (a collection of "Item"), and I want all the Items in mailbox "Gal" that are not marked as downloaded.
I'd be thankful for hint and even more thankful for a working example :)

Thanks.

Reply all
Reply to author
Forward
0 new messages