Additional fields to _sync:user or _sync:useremail documents

I want to store a user’s displayname in Couchbase. When a user signs in with OIDC, the sync gateway creates two documents: _sync:user and _sync:useremail. Can I store an additional field displayName in one of these documents or do I need to create an extra document for this which I then need to retrieve separately? Is there a designated place for such additional fields or can I just put it e.g. as an additional field in the _sync:useremail document (apart from the fact that I don’t understand why there is this second document).

There’s no ability to set custom fields on a user document created and managed by Sync Gateway. You’ll have to store a parallel document similar to the email one.

The underlying technical reason why we maintain a separate doc for useremail is so we can do a KV lookup on an email address for login, and link it back to a user without knowing a user’s name.