diff --git a/source/includes/fundamentals/code-snippets/gridfs.go b/source/includes/fundamentals/code-snippets/gridfs.go index 84fd08d5..45b243c2 100644 --- a/source/includes/fundamentals/code-snippets/gridfs.go +++ b/source/includes/fundamentals/code-snippets/gridfs.go @@ -51,5 +51,10 @@ func main() { panic(err) } fmt.Printf("New file uploaded with %d bytes written", bytes) + + // Calls the Close() method to write file metadata + if err := uploadStream.Close(); err != nil { + panic(err) + } // end OpenUploadStream example }