-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
PostgresSQL error - Syntax error at the end of input - Aggregation #1109 #6479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
No it does not. When // This aggregation works fine
Where as this does not.
Is there any test case to validate objectId working fine with Postgres aggregation? @dplewis @dplewis @davimacedo Moved this from JS SDK repo to here |
The error is because of the following line: It considers group _ids with only string and object syntax. But not, Query formed for 1 and 2 below
|
Hi @srameshr thanks for reporting. Would you be willed to tackle this one and send a PR with the fix? |
@davimacedo I am pressed on time and not good with Postgres either. I will give it a shot. |
@davimacedo Also, the number of combinations that can be formed via Mongo aggregation and mapped to Postgres is nearly limitless. How about an option that allows just to pass a string to the aggregate method instead of having incomplete and breaking implementations? Like, just pass a string to aggregate:
And pass this query directly to Node PGP instead of trying to requiring mongo like aggregate object to be passed. |
+1 for raw aggregate queries. It could return raw json to deal with. Even though you'll have to convert pointers, dates, etc by hand, it still can help to solve a bunch of complicated scenarios. I find it nearly impossible and not worth spending time to implement and support all the combinations of Mongo and Postgres versions and aggregate operators to comply with single SDK object format. |
@davimacedo @dplewis |
Thanks for the PR @srameshr . I've just merged it. About the raw aggregates, it looks a good idea. |
Issue Description
The below aggregation query does not work on POSTGRES while the same works with MONGODB
Steps to reproduce
Run the below query inside a cloud function, with user and media being string type columns.
Expected Results
Array of data with count and unique media and user values
Actual Outcome
It throw an error
Test Case
Environment Setup
Server
Operating System: AWS, Amazon Linux
JS SDK
Logs/Trace
The text was updated successfully, but these errors were encountered: