Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
It looks like nested JSON map-elements cannot be correctly referenced in MongoDB right now. Although I understand MongoDB aggregation framework doesn't allow referencing a specific element from an array (https://jira.mongodb.org/browse/SERVER-4589), but it could be done for JSON/object elements.
For documents like this...
```
{
...
"days_since_join" : NumberLong(0),
"dim_tech" :
,
"dim_user" :
}
```
If we do aggregation using SQL
```
SELECT calling_medium, count FROM visits GROUP BY calling_medium;
```
The aggregation pipeline should be something like
```
db.visits.aggregate(
{
$group:{
_id:"$dim_tech.calling_medium",
count:{$sum:1}
}
}
)
```
A dot (.) sign could distinguish the hierarchy.
---------------- Imported from GitHub ----------------
Url: https://github.com/julianhyde/optiq/issues/204
Created by: tikazyq
Labels:
Created at: Tue Mar 25 01:41:14 CET 2014
State: open