Closed
Description
When a create a new replication (database doesn't exist), I want to set CouchDB attribute "create_target": true.
Can you just add membre in CouchReplication class :
[DataMember]
[JsonProperty("create_target")]
public bool CreateTarget{ get; set; }
Usage :
string couchDBUrl = "http://localhost:5984/"; // Url from CouchDB server
string username = _tokenDecode.GetUsername();
string userCouchDBName = couchDBUrl + username + "_data";
// Looking for existance of this database
await _couchDBContext.Client.ReplicateAsync(
source: couchDBUrl + _couchDBContext.DatabaseName,
target: userCouchDBName,
replication: new CouchReplication() {
SourceCredentials = new CouchReplicationBasicCredentials(
_apiConfiguration.CouchDBLogin, _apiConfiguration.CouchDBPassword
),
TargetCredentials = new CouchReplicationBasicCredentials(
_apiConfiguration.CouchDBLogin, _apiConfiguration.CouchDBPassword
),
Continuous = true,
Selector = new { owner = username }
}
);