Is it possible to JOIN two different data sources in couchbase mobile?

I have created two different databases in mobile. I want to join them. How to do that?
Database 1, name = employee
Sample document: {
“name”: “Employee 1”,
“email”: "",
“department”: “department-01”

Database 2, name = department
“name”: “Department 01”,
“id”: “department-01”

Desired output: {
“name”: “Employee 1”,
“email”: "",
“departmentName”: “Department 01”

I have not tried this myself yet. Have you tried setting both databases as the sources in the JOIN part of your query?

Yes. Here is the sample query (in Android Java).

    DataSource departmentDS = DataSource.database(departmentDatabase).as("departmentDS");
    DataSource employeeDS = DataSource.database(employeeDatabase).as("employeeDS");

    Expression employeeDeptExpr ="department").from("employeeDS");

    Expression departmentCodeExpr ="id").from("departmentDS");

    Expression joinExpr = employeeDeptExpr.equalTo(departmentCodeExpr);

    Join join = Join.join(departmentDS).on(joinExpr);
    Query searchquery =

ResultSet rs = query.execute();
List resultList = rs.allResults();

resultList.size(); // is giving zero

No, we do not support cross database joins at this time. Is there a reason you have your documents in two different databases ?

What Priya said. In CBL you generally put related data in the same database.

I am using separate buckets for sync-able and local data which helps me in reducing the code complexity for better design.

Thats a good pattern for segregating local-only and sync-able data. However, if you need to do queries that span across databases then at this time, the recommended pattern would be to have a single database and to set up replication filters to filter out the local-only data.