Menu

update a JSON object using JavaScript

JSON objects are frequently used as a data format in the web world. Many times, we encounter situations where we need to update the JSON object or a part of the JSON object (JSON object property). In this blog, we will discuss how to update a part of a JSON object using JavaScript.

For example, we have a json object that have dimentions.

let dimensions = [

    {"height": 100, "width": 50},

    {"height": 200, "width": 150},

    {"height": 300, "width": 250},

    {"height": 400, "width": 350}

  ]

Supoose we now need to update the first width of the first diemension in the object. First check the current value with below statement.

dimensions[0].width

This will return 50. Since, the width of first diemnsion index is 50.  

Now update the value of width from index 0.

dimensions[0].width = '90'

For example, we have update the value with 90. Now, when you access the width value from index 0, it will return 90. Try accessing the first object from dimentions array object.

dimensions[0]

This will retun first object which is now updated width value. 

{

    "height": 100,

    "width": "90"

}

 

Below is the screenshot of the updating JSON object property use-case.

Update JSON object using JS
Update JSON object using JS


Asset Compute Service | Adobe Experience Cloud

The Asset Compute Service is a helpful tool in Adobe Experience Cloud that can handle digital files like images, videos, and documents. It can change these files into different versions, like making a small picture, creating rendition, pulling out text, or creating archives. Developers can also add their own custom tools to do specific jobs, like making special versions of files. These tools are made using Adobe Developer App Builder and run on Adobe I/O Runtime, which means they don't need their own servers to work.


Asset compute service architecture diagram
Asset compute architecture diagram | Adobe Experience League


Creating a custom worker

The Asset Compute worker is to create a more exciting version of the asset. This will show how powerful Asset Compute workers can be. Visit this page for develop a custom worker. https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/asset-compute/develop/worker.html?lang=en

Supported file formats

Almost all images and 3D image formats are supported in Asset compute. like JPEG, PNG, BMP etc. for more about the supported format please see the official page.   

The server's host key is not cached. You have no guarantee that the server is the computer you think it is.

If you are using ssh to login or recently updated your ssh keys but not updated in your application. Here we will see how we could fix this error in Sourcetree.

Steps to follow in Sourcetree

  1. Go to source tree
  2. Tool >> Options
  3. Update the SSH client and SSH Key
    How to update ssh keys in Sourcetree


  4. Save and retry your action

By updating known_host file

  1. We can find the known_host file at this location.
    • On Windows: The SSH known_hosts file is usually located at C:\Users\<Username>\.ssh\known_hosts.
    • On macOS/Linux: The file is typically located at ~/.ssh/known_hosts
  2. Open the file in edit mode and find the host or IP that you are trying to connect with.
  3. Copy the host key presented by the server and paste it into the known_hosts file, replacing the existing entry or adding a new one if it's not already there.