SyncGateway Multi Tenancy

A summary of what I am trying to do:

We have multiple tenants connecting to our sync gateway.
As we have never worked out how to apply multi tenancy, we have ended up creating new buckets for each tenant. This is obviously very wasteful memory wise.
We have tasked ourselves to come up with a way of creating multiple gateways (databases in sync speak, not services) getting filtered documents based on a property, (api or tenantid eg), and expose them through the same gateway.

We realized that you can’t create a sync gateway pointing to the same collection, so I have created a collection under the _default scope called othercollection.

This gives me the following schema: maindata._default.othercollection on the Couchbase server.
I then try and create a gateway that should only expose that collection:

{{publicsyncurl}}/othergateway/
{
“bucket”: “maindata”,
“num_index_replicas”: 0,
“import_docs”: true,
“offline”: false,
“scopes”: {
“_default”: {
“collections”: {
“othercollection”: {
}
}
}
}
}

But I get a 500 error: Keyspace not found in CB datastore: default:maindata._default.othercollection
This must be right, as if I change the collection to _default, it fails with the error that another gateway is using this namespace.
To reduce possible issues, my service user (serviceconfig.json) bootstraps and connects as Full Admin.
I have really tried everything, and have no choice but to reach out.
Regards
Monty

Sorry, editing formatting gives a 403 error!

{{publicsyncurl}}/othergateway/
{
    "bucket": "maindata",
    "num_index_replicas": 0,
    "import_docs": true,
    "offline": false,
    "scopes": {
        "_default": {
            "collections": {
                "othercollection": {
                }
            }
        }
    }    
}


Hi @garth - just to confirm, are you using the latest version of Sync Gateway and following the instructions here: Scopes and Collections Support in Couchbase Mobile for Edge Applications and here: Scopes and Collections Configuration for Sync Gateway | Couchbase Docs ? Also just to confirm, this is not currently supported with Capella App Services, but that is something we are actively working on.

@priya.rajagopal FYI