MongoDB.GridFS/GridFileInfo.cs
/// <summary>
/// Deletes all data in a file and sets the length to 0.
/// </summary>
Deletes all data in a file and sets the length to 0.
Deletes all data in a file and sets the length to 0 .
public void Truncate(){
            if(filedata.Contains("_id") == false) return;
            this.gridFile.Chunks.Delete(new Document().Append("files_id", filedata["_id"]));
            this.Length = 0;
            this.gridFile.Files.Update(filedata);
        }
public void Truncate ( ) { if ( filedata . Contains ( " " ) == false ) return ; this . gridFile . Chunks . Delete ( new Document ( ) . Append ( " " , filedata [ " " ] ) ) ; this . Length = 0 ; this . gridFile . Files . Update ( filedata ) ; }
Deletes all data in a file and sets the length to 0.
Deletes all data in a file and sets the length to 0 .