I suppose that with the line
col.update({'id': user[0]}, {'$set': user}, True)
where user[0] is a whole document of user collection, you are trying to update document where id is a whole document. You should write smth like:
col.update({'_id': user[0]['_id']}, {'$set': user}, True)
Moreover i don't understand what are you trying to do with the part {'$set': user}
. Read this and this.
To check that your query was ok you should pass the keyword argument safe=True
to the update method:
success = col.update({'id': user[0]}, {'$set': user}, True, safe=True)
print success
Sorry if i did not understand your problem correctly.