Is it possibility to have two databases for one bucket in sync gateway?


#1

This might sound little weird, I am trying to create two databases in SGW which access same bucket. Reason being at mobile we would like to share same session token for two logical databases. We don’t wanna create two set of same users and maintain two sessions.

“databases”: {

	"db1" :{
		"bucket":"TESTBUCKET",
		"server": "http://localhost:8091",
		"username": "xxxxxxx",
		"enable_shared_bucket_access": true,
		"import_docs": "continuous",
		"password": "xxxxxxxx",
		"users":{
		  "GUEST": {"disabled": true, "admin_channels": ["*"] }
			},
		"sync": `function sync(doc, oldDoc) {
					if(oldDoc == null){
						// some logic here
				}`,
                   import_filter" : `function(doc)
				{
                                       // only certain types to imported
				}`,
		}
	},
	"db2" :{
		"bucket":"TESTBUCKET",
		"server": "http://localhost:8091",
		"username": "xxxxx",
		"enable_shared_bucket_access": true,
		"import_docs": "continuous",
		"password": "xxxxxx",
		"users":{
		  "GUEST": {"disabled": true, "admin_channels": ["*"] }
			},
		"sync": `function sync(doc, oldDoc) {
				// some different logic
				}`,
		"import_filter" : `function(doc)
				{
                                       // only certain types to imported
				}`
}

#2

This is a duplicate post. See Is there possibility to have two databases for one bucket in sync gateway?