public CreateDesignDocument ( string bucket, string name, string document ) : bool | ||
bucket | string | |
name | string | |
document | string | |
Résultat | bool |
public bool CreateDesignDocument(string bucket, string name, string document)
{
if (string.IsNullOrEmpty(name)) throw new ArgumentException("Document name must be specified");
JObject jObj;
validateDesignDocument(document, out jObj);
var uri = getDesignDocumentUri(bucket, name);
var response = HttpHelper.Put(uri, _username, _password, document, HttpHelper.CONTENT_TYPE_JSON);
var jsonResponse = JObject.Parse(response);
return jsonResponse["ok"].Value<string>().Equals("true", StringComparison.CurrentCultureIgnoreCase);
}
CouchbaseCluster::CreateDesignDocument ( string bucket, string name, Stream source ) : bool |
public void SetUp() { _Client = CouchbaseClientFactory.CreateCouchbaseClient(); //TODO: uncomment this line when next NuGet (1.2.7) is pushed //log4net.Config.XmlConfigurator.Configure(); var cluster = new CouchbaseCluster("couchbase"); var stream = File.Open(@"Data\\ThingViews.json", FileMode.Open); cluster.CreateDesignDocument("default", "things", stream); }