Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@fcoury

Description

@fcoury

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions