Couchbase - N1QL query I'm trying to join two documents within same bucket and have to perform GroupBy "DepartmentName" and count on "TeamMemberID" whose "TerminalCheckinStatus" is "COMPLETED"
**First Type of Document**
docstore {
DepartmentName: "Medical",
TeamMemberID: "ABC123",
type: "TeamMember"
}
**Second Type of Document**
docstore {
TerminalCheckinStatus: "COMPLETED",
TeamMemberID: "ABC123",
type: "TeamMemberStatus"
}
First I'm trying to "JOIN" operation on two documents
select a.TeamMemberID, a.DepartmentName
FROM `docstore` a
JOIN `docstore` b
ON a.TeamMemberID = META(b).id;
But not getting any result. Both document have "TeamMemberID" in common field
I have been struggling with this for the past two days, any help in this regard will be highly appreciated. Thanks in advance :)