Search code examples
orientdb

How to Update Embedded map in orientdb?


I have a embedded map entry in my DB class as follows.

Json string:

{
"dataStep2": "{stepno: 2,content:'', icon:'plug icon', color:'olive', header:'Uptime Guarantee',headcolor:'ffffff', tagline:'Check out our plug-in marketplace',taglinecolor:'ffffff', isActive:true}",
    "dataStep3": "{stepno: 3,content:'', icon:'plug icon', color:'blue', header:'Uptime Guarantee',headcolor:'ffffff', tagline:'Check out our plug-in marketplace',taglinecolor:'ffffff', isActive:true}"
}

I want to update only one part oe embedded map. For a example "datastep2" values. Please Advice me to do this.

Thanks in advance.


Solution

  • You can use this query:

    update #24:0 set embed.dataStep2="{stepno: 2,content:'', icon:'plug icon', color:'green', header:'Uptime Guarantee',headcolor:'ffffff', tagline:'Check out our plug-in marketplace',taglinecolor:'ffffff', isActive:true}"
    

    Where #24:0 is a rid of the record that you want to update, and embed is the property containing EMBEDDEDMAP data with dataStep2 and dataStep3 from your example.