C# 클래스 NDB.RemoteDB

A simple wrapper class for the CouchDB HTTP API. No initialisation is necessary, just create an instance and call the appropriate methods to interact with CouchDB. All methods throw exceptions when things go wrong.
파일 보기 프로젝트 열기: Kirosoft/NouchDB 1 사용 예제들

공개 메소드들

메소드 설명
BatchGetDocs ( string server, string db, string content ) : string

Create a new document. If the document has no ID field, it will be assigned one by the server.

CountDocuments ( string server, string db ) : int

Get the document count for the given database.

CreateDatabase ( string server, string db ) : void

Create a new database.

CreateDocument ( string server, string db, string content ) : void

Create a new document. If the document has no ID field, it will be assigned one by the server.

DeleteDatabase ( string server, string db ) : void

Delete a database

DeleteDocument ( string server, string db, string docid ) : void

Delete a document.

ExecTempView ( string server, string db, string map, string reduce, string startkey, string endkey ) : string

Execute a temporary view and return the results.

GetAllDocuments ( string server, string db ) : NDB.DocInfo[]

Get information on all the documents in the given database.

GetChanges ( string server, string db, bool includeDocs = false, long since ) : JsonData

Get all changes from the database since a given change revision

GetDatabases ( string server ) : string[]

Get a list of database on the server.

GetDocument ( string server, string db, string docid ) : string

Get a document.

GetDocument ( string server, string db, string docid, string startkey, string endkey ) : string

Get a document.

RemoteDB ( ) : System

비공개 메소드들

메소드 설명
DoRequest ( string url, string method ) : string

Internal helper to make an HTTP request and return the response. Throws an exception in the event of any kind of failure. Overloaded - use the other version if you need to post data with the request.

DoRequest ( string url, string method, string postdata, string contenttype ) : string

Internal helper to make an HTTP request and return the response. Throws an exception in the event of any kind of failure. Overloaded - use the other version if no post data is required.

메소드 상세

BatchGetDocs() 공개 메소드

Create a new document. If the document has no ID field, it will be assigned one by the server.
public BatchGetDocs ( string server, string db, string content ) : string
server string The server URL
db string The database name
content string The document contents (JSON).
리턴 string

CountDocuments() 공개 메소드

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
리턴 int

CreateDatabase() 공개 메소드

Create a new database.
public CreateDatabase ( string server, string db ) : void
server string The server URL
db string The database name
리턴 void

CreateDocument() 공개 메소드

Create a new document. If the document has no ID field, it will be assigned one by the server.
public CreateDocument ( string server, string db, string content ) : void
server string The server URL
db string The database name
content string The document contents (JSON).
리턴 void

DeleteDatabase() 공개 메소드

Delete a database
public DeleteDatabase ( string server, string db ) : void
server string The server URL
db string The name of the database to delete
리턴 void

DeleteDocument() 공개 메소드

Delete a document.
public DeleteDocument ( string server, string db, string docid ) : void
server string The server URL
db string The database name
docid string The document ID.
리턴 void

ExecTempView() 공개 메소드

Execute a temporary view and return the results.
public ExecTempView ( string server, string db, string map, string reduce, string startkey, string endkey ) : string
server string The server URL
db string The database name
map string The javascript map function
reduce string The javascript reduce function or /// null if not required
startkey string The startkey or null not to use
endkey string The endkey or null not to use
리턴 string

GetAllDocuments() 공개 메소드

Get information on all the documents in the given database.
public GetAllDocuments ( string server, string db ) : NDB.DocInfo[]
server string The server URL
db string The database name
리턴 NDB.DocInfo[]

GetChanges() 공개 메소드

Get all changes from the database since a given change revision
public GetChanges ( string server, string db, bool includeDocs = false, long since ) : JsonData
server string The server URL
db string The database name
includeDocs bool
since long sequence number for the last checkpoint, defaults to 0 i.e. all changes
리턴 LitJson.JsonData

GetDatabases() 공개 메소드

Get a list of database on the server.
public GetDatabases ( string server ) : string[]
server string The server URL
리턴 string[]

GetDocument() 공개 메소드

Get a document.
public GetDocument ( string server, string db, string docid ) : string
server string The server URL
db string The database name
docid string The document ID.
리턴 string

GetDocument() 공개 메소드

Get a document.
public GetDocument ( string server, string db, string docid, string startkey, string endkey ) : string
server string The server URL
db string The database name
docid string The document ID.
startkey string The startkey or null not to use
endkey string The endkey or null not to use
리턴 string

RemoteDB() 공개 메소드

public RemoteDB ( ) : System
리턴 System