It looks like association keys are stored as integers, however this leads to a problem. Couchdb stores ids as strings, so all my associations fail because, e.g.
foreign key: 55368
actual id: 55368fce8b9939ff4a28acfafd065e07
Am I missing something obvious?