- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 170
unlink
        dr.dimitru edited this page Jul 22, 2018 
        ·
        7 revisions
      
    Unlink file an its subversions from FS.
This is low-level method. You shouldn't use it, unless you know what you're doing.
Unlike fs.remove if callback is not specified it wouldn't throw an exception on error.
- 
fileRef{Object} - FullfileRefobject, returned fromFilesCollection.findOne().get()
- 
version{String} - [Optional] If specified, only subversion will be unlinked
- 
callback{Function} - [Optional] Triggered after file is removed. If cursor has multiple files, will be triggered for each file. If file has multiple subversions, will be triggered for each version.
- Returns {FilesCollection} - Current FilesCollection instance
import { FilesCollection } from 'meteor/ostrio:files';
const Images = new FilesCollection({collectionName: 'Images'});
Images.unlink(Images.collection.findOne({}));
// OR:
Images.unlink(Images.collection.findOne({}), 'thumbnail');| Meteor-Files | Support | Try ostr.io | 
|---|---|---|
|  | If you found this package useful, — star it at GitHub and support our open source contributions with a monthly pledge, or submit a one-time donation via PayPal |  Monitoring, Analytics, WebSec, Web-CRON and Pre-rendering for a website |