You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in this case the value of $user_id is not captured.
I have tried many modifications, but without success. information available in this regard is scarce.
So I'm evaluating sending an empty pipeline to the aggregation hook. and handle it at that level, using the following approach:
Hi,
I need to perform data aggregation, but variables must be passed in the url and not via arguments ( ?aggregate={}).
I have the following hook enabled:
Request:
http://127.0.0.1/views/userid/media?aggregate={"$user_id":"639b51720ac10cbf4b0a3d43"}
Response:
Hook Output:
endpoint: media_por_user_id pipeline: [{'$match': {'user': '639b51720ac10cbf4b0a3d43'}}, {'$group': {'_id': '$user', 'medias': {'$push': {'media_filename': '$media_filename', 'media_status': '$media_status'}}}}]
Note how $user_id is captured correctly
2-. Trying to pass $user_id through the url:
Request:
http:/127.0.0.1/views/639b51720ac10cbf4b0a3d43/media
Response:
Hook Output:
endpoint: media_por_user_id, pipeline: [{'$match': {'user': '$user_id'}}, {'$group': {'_id': '$user', 'medias': {'$push': {'media_filename': '$media_filename', 'media_status': '$media_status'}}}}]
in this case the value of $user_id is not captured.
I have tried many modifications, but without success. information available in this regard is scarce.
So I'm evaluating sending an empty pipeline to the aggregation hook. and handle it at that level, using the following approach:
But before going to that stage I would like to have clarification if it is a configuration error or Eve does not support this feature.
Thanks
The text was updated successfully, but these errors were encountered: