apache / apache/couchdb

Add aggregation functions to Mango

Open
#1,254 10 comments 28 reactions 0 assignees View on GitHub
mango roadmap
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

The Mango query language provides CRUD operations and basic selector syntax for document retrieval.
There are no aggregation functions.
Thus, Mango does currently not have an equivalent to 'reduce' and 'rereduce' functions as provided by JavaScript MapReduce.

## Expected Behavior
The `_find` endpoint should provide syntax and sensible keywords such as sum, average, minimum, maximum to facilitate the aggregation of values into a single field.
This change would enable users to write more powerful queries in Mango without prior knowledge of JavaScript or the MapReduce framework.

## Current Behavior
None.
Mango is limited to selector/'map' syntax, so to aggregate/'reduce' data, users have to turn to JavaScript MapReduce.

## Context
I'm a student in the final stages of my master's degree in computer science. I made a few non-code contributions to CouchDB. I would like to add this functionality to Mango, and make this my first code contribution to the project.

Contributor guide

Open the contributing guide

Research direction

Start with the Mango query language and the _find endpoint, then compare its selector/map behavior with JavaScript MapReduce reduce and rereduce functions. Define the aggregation syntax and behavior for sum, average, minimum, and maximum, including how results are represented; the issue names no files or tests, so those entry points must be located first.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang, javascript
Domain
api, backend-api-design, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.