I am trying to substitute the "value" in the below snippet using a variable value but no luck.
last_error = posts.update(
{'permalink':permalink},
{ '$inc':
{ 'comments."value".num_likes': 1 }
},
upsert=False,
manipulate=False, safe=True
)
The variable holds values like 0,1,2,3 etc and needs to update an array based on the array position (Here the array position is determined by the array value).
Not sure how to pass the variable value to the update command. I tried things like {value} ...[value] between the comments and numlikes. Nothing worked.