Error trying to upsert with a variable

I am totally confused … when a programmatically build a variable to pass to upsert, I get an error

TypeError: upsert() missing 1 required positional argument: 'value'

yet, if I print out the value and use it in the upsert command it works just fine …

upsertCmd = 
'dougc6', { '0':'86554','1':'...','3':'Customer','4':'......22...35..5','5':'...','6':'TW','7':'408','8':'056900463','9':'-4620','24':'971361563','30':'16068','55':'sdfsdf@HOTMAIL.COM','59':'A','79':'0','86':'16068','88':'D','101':'16322','102':'1','118':'0952240847','120':'70515964','121':'18103','122':'84','124':'3','125':'TWN','134':'MANDYSHU901136','177':'16068','213':'sdfsdfsf@HOTMAIL.COM','226':'TWN','236':'0','327':'10665','328':'16736','403':'16103','404':'17877','408':'5340','422':'17739'}

the above is a print of a variable called upsertCmd, if I do:

cb.upsert(upsertCmd)

I get the error:

TypeError: upsert() missing 1 required positional argument: 'value'

if I do:

cb.upsert('dougc6', { '0':'3454','1':'...','3':'Customer','4':'......22...35..5','5':'...','6':'TW','7':'408','8':'056900463','9':'-4620','24':'971361563','30':'16068','55':'dfgdfg@HOTMAIL.COM','59':'A','79':'0','86':'16068','88':'D','101':'16322','102':'1','118':'0952240847','120':'70515964','121':'18103','122':'84','124':'3','125':'TWN','134':'MANDYSHU901136','177':'16068','213':'dfgdfg@HOTMAIL.COM','226':'TWN','236':'0','327':'10665','328':'16736','403':'16103','404':'17877','408':'5340','422':'17739'})

it works just fine, any ideas or suggestions welcomed!

thanks

dougc

Check API, I think it needs minimum 2 arguments. First one document key , second one value (i.e document).

thank you I now see I need two variables, thank you very much, sorry I should of seen the issue

thanks again

dougc