Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6202659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:46:30+00:00 2026-05-24T04:46:30+00:00

Just learning Map/Reduce and I’m missing a step. I’ve read this post ( RavenDB

  • 0

Just learning Map/Reduce and I’m missing a step. I’ve read this post ( RavenDB Map-Reduce Example using .NET Client ) but can’t quite make the jump to what I need.

I have an object:

public class User : IIdentifiable
{
    public User(string username)
    {
        Id = String.Format(@"users/{0}", username);
        Favorites = new List<string>();
    }

    public IList<string> Favorites { get; protected set; }

    public string Id { get; set; }
}

What I want to do is get Map/Reduce the Favorites property across all Users. Something like this (but this obviously doesn’t work):

 Map = users => from user in users
                from oil in user.Favorites
                select new { OilId = oil, Count = 1 };
 Reduce = results => from result in results
                     group result by result.OilId into g
                     select new { OilId = g.Key, Count = g.Sum(x => x.Count) };

For example, if User1 has favorites 1, 2, 3 and User 2 has favorites 1,2, then this should return back {{OilId=3, Count =1}, {OilId=2, Count = 2}, {OilId=1,Count = 2}}

The current code produces an exception: System.NotSupportedException : Node not supported: Call

I feel like I’m close. Any help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:46:31+00:00Added an answer on May 24, 2026 at 4:46 am

    I wrote a small application replicating your code, but I don’t see the exception thrown. See my code here: http://pastie.org/2308175. The output is

    Favorite: 1, Count: 2

    Favorite: 2, Count: 2

    Favorite: 3, Count: 1

    which is what I would expect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just learning mapReduce. I have the following map reduce function being called on
I just learning yii framework and read this tutorial about yii how to setup
I'm just learning Ruby on Rails. I've read a few books, I've watched lots
I'm just learning to work with partial classes in VB.NET and VS2008. Specifically, I'm
I'm just learning asp.net mvc and I'm trying to figure out how to move
I'm just learning how to do things, and want to start using some sort
Hey, I'm just learning ruby on rails and I've been stumped on this for
I've just started learning Clojure, if I define the following map: (def distributions {:normal
I'm learning HQL and I've an object with a Map property like this: @ElementCollection
Just learning Silverlight 4/RIA and i 'm stuck in a weird problem: setup an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.