仅用作个人笔记,如对他人有帮助最好,不喜勿喷。
1.Json格式对象
Public class ObjTest
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("Value")]
public string Value{ get; set; }}
}
2.新增和删除对象;
try
{var item = client.StoreJson(StoreMode.Add, "" + i + "", newObjTest, DateTime.Now.AddMinutes(+5))
//var item = client.StoreJson(StoreMode.Add, "" + i + "", newObjTest);Console.ReadLine();
3.Webconfig设置
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="couchbase" type="Couchbase.Configuration.CouchbaseClientSection, Couchbase" />
</configSections>
<couchbase>
<servers bucket="******" bucketPassword="********">
<add uri="http://192.168.0.***:8091/pools" />
<!--<add uri="http://192.168.0.***:8091/pools"/>-->
</servers>
</couchbase>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>