Updating Cloudant documents via Hierarchical Data stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
rjhankey
Premium Member
Premium Member
Posts: 28
Joined: Mon Sep 19, 2011 2:04 pm
Location: Portage MI

Updating Cloudant documents via Hierarchical Data stage

Post by rjhankey »

I have a job that reads data from DB2, then uses the Hierarchical Data stage to compose JSON and insert those documents via a REST step into Cloudant. That's all working great!

When I want to run the job a second time -- I'm going to be getting quite a few document IDs that Cloudant has already seen, so I need a way to lookup the current rev level of each Cloudant doc ID in order to cause those operations to behave as updates instead of inserts.

I currently have a DB2 stage feeding a transformer, which then relays the data to the Hier Data stage. Can I leverage an additional REST step in the assembly that takes the incoming docID and looks up the rev before passing the JSON to the REST step that handles the Cloudant load? Or, is there a better way to skin this cat?

Thanks!
Post Reply