Permalink
Browse files

documenting

  • Loading branch information...
1 parent ea6a0dc commit 93772379e653197d1bb1d9af162908dffc68019a Nathan committed Nov 12, 2009
Showing with 18 additions and 3 deletions.
  1. +18 −3 lib/couchdb/database.js
View
@@ -3,6 +3,7 @@ var util = require("util");
Database = {
/**
* List of all documents in the database.
+ *
* @param {Object} options
* @returns Rows from the _all_docs query
* @type Array
@@ -29,6 +30,14 @@ Database = {
return results;
},
+ /**
+ * Save a document
+ *
+ * @param {Object} doc Document to save
+ * @param {Boolean} shouldThrow Should raise an exception when fails?
+ * @returns true for success, false if shouldThrow is false and the save fails
+ * @type Boolean
+ */
save: function(doc, shouldThrow){
var saved = false;
if (shouldThrow === undefined){
@@ -59,7 +68,8 @@ Database = {
},
/**
* Deletes a document from the database
- * @param id Id of the document to remove
+ *
+ * @param {Object} doc Document to remove
*/
removeDoc: function(doc) {
var removed = false;
@@ -77,7 +87,11 @@ Database = {
return removed;
},
/**
- * Bulk save documents with the couchdb bulk save API
+ * Bulk save documents with the CouchDB bulk save API
+ *
+ * Bulk Document API:
+ * http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API
+ *
* @param {Object} docs Documents to save
* @param {Boolean} shouldThrow Should throw an error if fail?
* @returns True if save succeded, false if shouldThrow is false and bulkSave failed.
@@ -188,7 +202,8 @@ Database = {
}
},
/**
- * Retrieve a couchdb view.
+ * Retrieve a CouchDB view
+ *
* @param designDocName
* @param viewName
* @param options

0 comments on commit 9377237

Please sign in to comment.