0

I retrieved user information using api.followers in tweepy and am trying to store them in couchDB, but I keep getting this error message "u'doc validation, u'Bad Special document member" _json".

def save_user(self, u):
    temp = jsonpickle.encode(u)
    temp_obj = json.loads(temp)
    user_obj = temp_obj['py/state']
    self.db.save(user_obj)

u is the user profile returned by the command

for user in api.followers(screen_name="sharonsanderso6"): storage.save_user(user)

directly storing user to couchDB gives an error "string indices must be integers,not str". So tried decoding it using jsonpickle and json.loads. after doing this I get u'Bad character error. How else can I store it couchDB?

1 Answers1

0

Bad Special document member _json

CouchDB reserves JSON properties beginning with an underscore for itself. Change the key of the property to something that doesn't starts with underscore.

Ingo Radatz
  • 1,225
  • 8
  • 9