javascriptramda.js

I try to use Ramda for deleted the files with file deleted=null


From a mongo collection I have a deleted field, this field is null or has a date, I am trying to get only the documents whose deleted is with date, or in other words, to eliminate those whose deleted: null, for this I am using ramda but it only returns all the documents.

 , deletedFilesList () {
  return reject(equals(null))(this.rows);
}

Any idea??


Solution

  • For a Ramda approach, you'll need a predicate that looks at a given prop:

    return filter(propSatisfies(is(String), 'deleted'))(this.rows);