filter

filters files in the list by some criteria

void filter(object|function criteria);
criteriaobject|functionthe filtering criteria

Example

// simple filtering with a configuration object
vault.data.filter({ by:"status", match:"queue" });
 
// more complex filtering with a function
vault.data.filter(function(file){
    file.status === "failed" && file.size > 20000;
});

Related samples

Details

The criteria parameter set as object has the following attributes:

  • by - (string) the key of the file attribute
  • match - (string) the value of the file attribute

To revert Vault to the initial state, call the filter() method without parameters.

vault.data.filter(); // show all files
See also
Back to top