NDB.RemoteDB.CountDocuments C# (CSharp) Method

CountDocuments() public method

Get the document count for the given database.
public CountDocuments ( string server, string db ) : int
server string The server URL
db string The database name
return int
        public int CountDocuments(string server, string db)
        {
            // Get information about the database...
            string result = DoRequest(server + "/" + db, "GET");

            // The document count is a field within...
            JsonData d = JsonMapper.ToObject(result);
            int count = int.Parse(d["doc_count"].ToString());
            return count;
        }