Aggregation query parameter does not replace keys in the lists #1025
Comments
I solved the issue like this: def parse_aggregation_stage(d, key, value):
if isinstance(d, dict):
for st_key, st_value in d.items():
if isinstance(st_value, dict) or isinstance(st_value, list):
parse_aggregation_stage(st_value, key, value)
if key == st_value:
d[st_key] = value
if isinstance(d, list):
for st_idx, st_value in enumerate(d):
if isinstance(st_value, dict) or isinstance(st_value, list):
parse_aggregation_stage(st_value, key, value)
if key == st_value:
d[st_idx] = value |
Did you do the PR? |
+1 this resolves my problem. |
Hi, there is a work around for this problem. For example, if you have the following end points, which doesn't work as
However, you can overcome this problem by defining the endpoint like:
The query url is like
Note you need to use I have tested on my computer and it works. |
This was referenced Sep 3, 2017
I'm having a similar problem and haven't had much luck. Is the unterminated quote in your example on |
@aarobc sorry, it should be a typo and the correct case would be |
Solved by #1058 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was working on an aggregation endpoint:
However, I found that
$family_id
and$user_id
are not getting replaced since the code only covers the case of a pure dictionary without lists.See:
eve/eve/methods/get.py
Line 126 in 22ea4bf
I'm new to Eve, so I'm not sure that what I found worth an error report. Though it took me quite a time to debug.
Best regards,
Youngjae
PS, Eve is AWESOME.
The text was updated successfully, but these errors were encountered: