couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garrensmith <...@git.apache.org>
Subject [GitHub] couchdb pull request: Implement bulk deletion for all-docs-listing
Date Mon, 12 May 2014 09:54:31 GMT
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/221#discussion_r12520749
  
    --- Diff: src/fauxton/app/addons/documents/views.js ---
    @@ -610,48 +663,17 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
           this.render();
         },
     
    -    /*
    -     * TODO: this should be reconsidered
    -     * This currently performs delete operations on the model level,
    -     * when we could be using bulk docs with _deleted = true. Using
    -     * individual models is cleaner from a backbone standpoint, but
    -     * not from the couchdb api.
    -     * Also, the delete method is naive and leaves the body intact,
    -     * when we should switch the doc to only having id/rev/deleted.
    -     */
         bulkDelete: function() {
    -      var that = this;
    -      // yuck, data binding ftw?
    -      var eles = this.$el.find("input.row-select:checked")
    -                         .parents("tr.all-docs-item")
    -                         .map(function(e) { return $(this).attr("data-id"); })
    -                         .get();
    +      var that = this,
    +          documents = this.bulkDeleteDocsCollection.toArray(),
    --- End diff --
    
    This could be changed to just the documents length as you never use the actual docs in
this method. So `var documentsLength = this.bulkDeleteDocsCollection.length`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message