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

comparing two columns leads to always True #574

Open
blacksages opened this issue Nov 4, 2024 · 0 comments
Open

comparing two columns leads to always True #574

blacksages opened this issue Nov 4, 2024 · 0 comments

Comments

@blacksages
Copy link

Version: tinydb==4.8.2

Here's the database:

{"_default": {"1": {"name": "bob", "age": 25, "belly": "blown"}, "2": {"name": "dylan", "age": 26, "belly": "flat"}, "3": {"name": "inflated", "age": 27, "belly": "inflated"}}}

Here's the code:
db.update({'name': 'cooper'}, Query().belly == Query().name)
or
db.update({'name': 'cooper'}, Query()['belly'] == Query().['name'])

Expected result : only the last entry should have its name updated (because both "belly" and "name" are "inflated")

Actual result : all entries have their names updated

@blacksages blacksages changed the title comparing two table leads to always True comparing two columns leads to always True Nov 4, 2024
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

No branches or pull requests

1 participant