first off, you shouldn't ever have to emit the whole doc. This makes the index bigger on disk, and it's redudant since you can get the whole doc easily from a view row (the doc id is always included, and the SDKs will transparently fetch it for you usually).
in your case though, you may actually need that second part of emit. Select the attributes you are interested in and emit them in an array (like emit(doc.user_id, [doc.attributeA, doc.attributeB])
), thus effectively "filtering out" _sync
.
only problem is that if later on you add an attributeC
to your users, it won't automatically be included (so it filters out attributes not explicitly listed in the map function). does that make sense?