I need get doc where createdBy=userId or updatedBy= userId. I have next map func in CouchDB:
function (doc) {
if (doc.$doctype === 'Records') {
emit([doc.createdBy, doc.updatedBy], doc);
}
}
And node.js backend
getData: async (userId) => {
return await adapter.getRows(
'Records', 'url',
{
startkey: [userId, userId],
endkey: [userId],
}
);
}
but it works as operator AND. Please help me find mistake.