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

  • Home
  • SEARCH
  • 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 8539073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:16:34+00:00 2026-06-11T11:16:34+00:00

I was going through kinvey (BAAS) documentation and I came across Aggregation concept using

  • 0

I was going through kinvey (BAAS) documentation and I came across Aggregation concept using Map/reduce.

http://docs.kinvey.com/rest-aggregation.html

Since Kinvey does not have the .Net SDK, the only option that we have is to use the Rest API.
I am familiar with REST API, but , as per the documentation (link above), but, How do I construct the Map/Reduce syntax in the API request parameters in the C# backend code ?

The windows Phone app , that we would like to make will have C# Code in the back end. and there are couple of aggregation modules/Data points that we would like to display in the app. I wanted to utilize the Map/reduce functionality provided by kinvey as it runs on MongoDB, rather than using linq and doing the processing in the code.

I would appreciate if someone could shed some light on it.

Thanks
Rahul

  • 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-06-11T11:16:35+00:00Added an answer on June 11, 2026 at 11:16 am

    You want to send a POST request to /appdata/:appKey/:collectionName/_group, where :appkey is the app id and :collectionName is the particular collection you want to run the aggregation on.

    Then in the body, you want to specify the map/reduce parameters:

    {
      "key": {
        "lastName":true
      },
      "initial": {
        "count": 0
      },
      "reduce": "function(doc,out){ out.count++;}",
      "condition": {
        "age": { "$gt":31 }
      }
    }
    

    In this example, the “key” specifies the entity column names that will be aggregated. Most of the time you’ll just want to do one, but you can specify multiple. “initial” seeds the reduce starting value, since this is a counting example, it’s started at zero. The “reduce” is a javascript function; it passes in the entity (doc) and our return object (out). If you wanted to sum everyone’s age instead of the number of people, it would like: out.count += doc.age. Finally you can specify an optional “condition“; this is a filter using the query language, only entities that satisfy the condition will be evaluated.

    For reference, here is the MongoDB aggregation documentation. You should be able to everything listed in there http://www.mongodb.org/display/DOCS/Aggregation

    And the Kinvey documentation for the query syntax: http://docs.kinvey.com/rest-filtering.html (remember this is part of the condition in the body object, not in the POST uri).

    In case you need it, here’s a question about converting a Dicitonary to JSON. How do I convert a dictionary to a JSON String in C#?

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

Sidebar

Related Questions

Going through some documentation on modifying CGImageRef data, I came across a strange example
While going through Effective C++ (by Scott Meyers), I came across the following code
While going through a Zend tutorial , I came across the following statement: Note
while going through some of the mili source code I came across a struct
While going through the exercises, I came across something that, even after research, I
After going through the build process (found at: http://source.android.com/source/building.html ) for the master branch
When going through the Requirements of a JAX_WS Endpoint, I came across this, JAX-WS
After going through so many documents and online content like: http://stackoverflow.com/questions/4066167/sencha-touch-or-jquery-mobile http://stackoverflow.com/questions/5093691/sencha-touch-vs-jqtouch-vs-gwt-mobile-vs-xui-vs-jquery-mobile-vs http://www.quora.com/Were-deciding-between-jQuery-Mobile-currently-in-alpha-and-Sencha-Touch-What-are-the-pros-and-cons-for-each http://interfacethis.com/2011/adventures-in-html5-part-one/
After going through the article at http://geekexplains.blogspot.com/2008/06/diff-between-externalizable-and.html , i got to know Externalizable is
While going through the scala documentation ( Play Docs ) of the play framework

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.