![]() |
![]() |
![]() |
Reference Manual for CouchDB GLib Bindings | ![]() |
---|---|---|---|---|
Top | Description |
CouchdbDesignDocument; CouchdbDesignDocumentClass; CouchdbDesignDocument * couchdb_design_document_new (void
); GSList * couchdb_design_document_list_views (CouchdbDesignDocument *document
); void couchdb_design_document_free_views_list (GSList *list
); void couchdb_design_document_add_view (CouchdbDesignDocument *document
,const char *name
,const char *map_function
,const char *reduce_function
); void couchdb_design_document_delete_view (CouchdbDesignDocument *document
,const char *name
); enum CouchdbDesignDocumentLanguage; CouchdbDesignDocumentLanguage couchdb_design_document_get_language (CouchdbDesignDocument *document
); void couchdb_design_document_set_language (CouchdbDesignDocument *document
,CouchdbDesignDocumentLanguage language
);
typedef struct { CouchdbDocumentClass parent_class; } CouchdbDesignDocumentClass;
CouchdbDesignDocument * couchdb_design_document_new (void
);
Create a new design document, to contain views' code.
Returns : |
A new CouchdbDesignDocument object. |
GSList * couchdb_design_document_list_views (CouchdbDesignDocument *document
);
Return a list of the names of the views contained in the given CouchdbDesignDocument object.
|
A CouchdbDesignDocument object |
Returns : |
A list of names of views. When no longer needed, this list should be freed by calling couchdb_design_document_free_views_list. |
void couchdb_design_document_free_views_list
(GSList *list
);
Free the list of views' names returned by couchdb_design_document_list_views.
|
A list of views' names, as returned by couchdb_design_document_list_views |
void couchdb_design_document_add_view (CouchdbDesignDocument *document
,const char *name
,const char *map_function
,const char *reduce_function
);
Add a new view to the given CouchdbDesignDocument object. If the view already exists, it will get replaced by the new one. To make the change permanent, the document must be saved to the database by calling couchdb_database_put_document.
|
A CouchdbDesignDocument object |
|
Name of the view |
|
Source code for the map function |
|
Source code for the reduce function |
void couchdb_design_document_delete_view (CouchdbDesignDocument *document
,const char *name
);
Delete a view from the given CouchdbDesignDocument object. To make the change permanent, the document must be saved to the database by calling couchdb_database_put_document.
|
A CouchdbDesignDocument object |
|
Name of the view to remove |
typedef enum { COUCHDB_DESIGN_DOCUMENT_LANGUAGE_UNKNOWN, COUCHDB_DESIGN_DOCUMENT_LANGUAGE_JAVASCRIPT, COUCHDB_DESIGN_DOCUMENT_LANGUAGE_PYTHON } CouchdbDesignDocumentLanguage;
CouchdbDesignDocumentLanguage couchdb_design_document_get_language
(CouchdbDesignDocument *document
);
Return the programming language in which the views on the given design document are written.
|
A CouchdbDesignDocument object |
Returns : |
A value representing the language the views are written in. |
void couchdb_design_document_set_language (CouchdbDesignDocument *document
,CouchdbDesignDocumentLanguage language
);
Set the language used in the views contained in the given CouchdbDesignDocument object.
|
A CouchdbDesignDocument object |
|
Language for the views in this design document |