Skip to main content
Question

Compare and update Json into DB


geo-x
Contributor
Forum|alt.badge.img+5
  • Contributor

Dear FME community.

I would like to compare to database who contains json (with subobjects).

The aim is to UPDATE, DELETE or INSERT json into the target DB

Inforamtion : the base 2 may be to json format or "classical" attributes format.

What is the better way to do this ?

Thanks.

5 replies

takashi
Influencer
  • July 20, 2020

Hi @lalandexavier, a possible way I can think of is, use the JSONExtractor to extract ID and other attributes which you need to compare and then use the ChangeDetector to compare the objects.


geo-x
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • July 20, 2020
takashi wrote:

Hi @lalandexavier, a possible way I can think of is, use the JSONExtractor to extract ID and other attributes which you need to compare and then use the ChangeDetector to compare the objects.

Hi @takashi it's a pleasure to read you.

In this case I'm reading data from AWS DynamoDB, it's NoSQL DB.

I checked the field dynamodb_Json in String type :

 

In the transformer JSONExtractor I can do the extract like that :

And that's ok !

Now I've a problem with the ChangeDetecor because I've ID to join and I can't do that with this and I've a problem with the date.

I've the same values but the ChangeDetector give me Added and Deleted :

Do you understand how can I do ?


geo-x
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • July 20, 2020
takashi wrote:

Hi @lalandexavier, a possible way I can think of is, use the JSONExtractor to extract ID and other attributes which you need to compare and then use the ChangeDetector to compare the objects.

Sorry it's ok I had problem with the Parse of my date. But How can I do a join on ID with the ChangeDetector ?


takashi
Influencer
  • July 20, 2020
geo-x wrote:

Sorry it's ok I had problem with the Parse of my date. But How can I do a join on ID with the ChangeDetector ?

Try setting the ID attribute to the Update Detection Key Attribute parameter.


geo-x
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • July 22, 2020
takashi wrote:

Try setting the ID attribute to the Update Detection Key Attribute parameter.

I think you're a most modern version version of FME than me :-)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings