Deleting a file on server side Without collectionFS


#1

Hi there.
All is in the tile : is it possible to delete file on the server without using collectionFS ?

Without entering in detail, i’m using a mongoConnector writed in java to connect differents databases, and I would like to not use this package to prevent some bugs in future !

Thanks for advices


#2

https://nodejs.org/api/fs.html#fs_fs_unlink_path_callback

const fs = require('fs');

fs.unlink('/tmp/hello', (err) => {
  if (err) throw err;
  console.log('successfully deleted /tmp/hello');
});

#3

Hi Rhywden and thanks for your answer !
That’s exactly what i was seeking ! :slight_smile: