Skip to content
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

Fix aggregate group id #5994

Merged
merged 4 commits into from
Sep 2, 2019

Conversation

davimacedo
Copy link
Member

Close #5989

@davimacedo davimacedo requested a review from dplewis August 29, 2019 03:34
@davimacedo
Copy link
Member Author

@dplewis I will still add a test case.

@davimacedo
Copy link
Member Author

@dplewis it should be good now

@codecov
Copy link

codecov bot commented Aug 29, 2019

Codecov Report

Merging #5994 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5994      +/-   ##
==========================================
- Coverage   93.68%   93.65%   -0.03%     
==========================================
  Files         156      156              
  Lines       10926    10926              
==========================================
- Hits        10236    10233       -3     
- Misses        690      693       +3
Impacted Files Coverage Δ
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.23% <100%> (-0.71%) ⬇️
src/RestWrite.js 93.56% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e84732...43a7841. Read the comment docs.

@davimacedo davimacedo requested a review from acinader August 31, 2019 01:33
Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is funny and could be an advertisement against javascript :).

this solution looks good to me, but is hard to read.

Here's my take at a test that is easier to read:

_.isNil(v) || _.isEmpty(v) && !_.isNumber(v);

here's a test of it: https://runkit.com/arthur/reallyempty

def not asking you to change it, but I just couldn't resist trying to futz with it ;).

I'd be surprised if there isn't a more concise test, but I tried.

@davimacedo
Copy link
Member Author

It is really weird. What we want to do in that line is actually return null if:

  • it is null
  • it is undefined
  • it is an empty string
  • it is an object with no keys
  • it is an array with no elements

I suspect there is no beautiful way to do this :)

Your solution fails for boolean. Se here: https://runkit.com/adavimacedo/5d6ca8163db2fb001a475448

@davimacedo davimacedo merged commit ac353ca into parse-community:master Sep 2, 2019
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
* Fix aggregate group id

* Improve implementation

* Add test case

* Fix postgres test - it does not work with group and sort at same time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

objectId is null while using group pipeline with number
2 participants