UPDATE Query with missing or null value in path

UPDATE fsm
USE KEYS "unique-key-of-the-single-document"
SET
    he.fs_geo_pt_location= {}
         FOR he IN `hvacr_equipment` WHEN he.`_id` = "some-unique-id-value" AND he.fs_geo_pt_location IS NOT VALUED END,
    he.fs_geo_pt_location.testing = "testing123"
         FOR he IN `hvacr_equipment` WHEN he.`_id` = "some-unique-id-value" END,
WHERE doc_type = "hvacr_system"

If fs_geo_pt_location is not a object you will have same problem. If you want you can change he.fs_geo_pt_location IS NOT VALUED to IS_OBJECT(he.fs_geo_pt_location) = false

1 Like