使用c#,couchdb和LoveSeat的正确的hello world程序是什么
||
我正在尝试在C#中将一个简单的hello世界存储在一个ouchdb数据库中(总共是新手)。
我正在使用LoveSeat(但如果有帮助,可以随时建议其他客户)并创建了以下简单代码:
static void Main(string[] args)
{
var cl = new CouchClient(\"myserver\", 5984, null, null);
var db = cl.GetDatabase(\"mydb\");
var newDoc = db.CreateDocument(@\"{
\"\"Test\"\":\"\"ValueTest\"\"
}\"
);
var newDoc2 = db.SaveDocument(newDoc);
}
该文档实际上是创建的:
{
\"_id\": \"805656b6113d30a5387230a669000bb6\",
\"_rev\": \"1-44c5768a2fa004c6a43899687c283517\",
\"Test\": \"ValueTest\"
}
但是当我查看生成的newDoc2时,我看到了:
{
\"error\": \"file_exists\",
\"reason\": \"The database could not be created, the file already exists.\"
}
我做错什么了吗 ?
谢谢
没有找到相关结果
已邀请:
2 个回复
峨躬坎抬焚
舶啥戚
因此如果为
,则SaveDocument与CreatDocument相同 如果为“ 5”,则SaveDocument实际上是\“ UpdateDocument \”。 您的代码属于前一种情况: