/// <summary> /// Get information on all the documents in the given database. /// </summary> /// <param name="server">The server URL</param> /// <param name="db">The database name</param> /// <returns>An array of DocInfo instances</returns> public DocInfo[] GetAllDocuments(string server, string db) { string result = DoRequest(server + "/" + db + "/_all_docs", "GET"); List <DocInfo> list = new List <DocInfo>(); JsonData d = JsonMapper.ToObject(result); foreach (JsonData row in d["rows"]) { DocInfo doc = new DocInfo(); doc.ID = row["id"].ToString(); doc.Revision = (row["value"])["rev"].ToString(); list.Add(doc); } return(list.ToArray()); }
/// <summary> /// Get information on all the documents in the given database. /// </summary> /// <param name="server">The server URL</param> /// <param name="db">The database name</param> /// <returns>An array of DocInfo instances</returns> public DocInfo[] GetAllDocuments(string server,string db) { string result=DoRequest(server+"/"+db+"/_all_docs","GET"); List<DocInfo> list=new List<DocInfo>(); JsonData d=JsonMapper.ToObject(result); foreach(JsonData row in d["rows"]) { DocInfo doc=new DocInfo(); doc.ID=row["id"].ToString(); doc.Revision=(row["value"])["rev"].ToString(); list.Add(doc); } return list.ToArray(); }