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

Updates with $inc for double values don't work #15

Open
fcoury opened this issue Jul 16, 2022 · 0 comments
Open

Updates with $inc for double values don't work #15

fcoury opened this issue Jul 16, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@fcoury
Copy link
Owner

fcoury commented Jul 16, 2022

We get the following query:

UPDATE "db_test"."test_collection_1657995566780048000"
    SET _jsonb = _jsonb ||
        json_build_object('v', COALESCE(_jsonb->'v')::numeric + 10)::jsonb || json_build_object('z', COALESCE(_jsonb->'z')::numeric + -2)::jsonb
     WHERE (CASE WHEN (_jsonb->'one' ? '$f') THEN (_jsonb->'one'->>'$f')::numeric ELSE (_jsonb->'one')::numeric END) = '1'

When we need to append the ->'$f' to properly update float fields.

This probably also applies to regular field updates.

@fcoury fcoury added the bug Something isn't working label Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant