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

docs(mango): match description of $mod with reality (3.3.x) #4392

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

pgj
Copy link
Contributor

@pgj pgj commented Jan 19, 2023

Backport of aff7a6e.

The remainder argument for the `$mod` operator can be zero, while
its documentation suggests otherwise.  It actually covers a very
realistic use case where divisibility is expressed.

Neither related restrictions could be identified in the sources
[1] nor MongoDB forbids this [2].  Tests also seem to exercise this
specific case [3].  Thanks @iilyak for checking on these.

[1] https://github.com/apache/couchdb/blob/adf17140e81d0b74f2b2ecdea48fc4f702832eaf/src/mango/src/mango_selector.erl#L512:L513
[2] https://www.mongodb.com/docs/manual/reference/operator/query/mod/
[3] https://github.com/apache/couchdb/blob/0059b8f90e58e10b199a4b768a06a762d12a30d3/src/mango/test/03-operator-test.py#L58
@pgj pgj changed the title docs(mango): match description of $mod with reality docs(mango): match description of $mod with reality (3.3.x) Jan 19, 2023
Copy link
Contributor

@nickva nickva left a comment

Choose a reason for hiding this comment

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

+1

Thank you for your contribution, @pgj

@nickva nickva merged commit 74606ff into apache:3.3.x Jan 19, 2023
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.

None yet

2 participants