diff --git a/source/includes/fundamentals/code-snippets/gridfs.go b/source/includes/fundamentals/code-snippets/gridfs.go index 5c830cc3..27c3503e 100644 --- a/source/includes/fundamentals/code-snippets/gridfs.go +++ b/source/includes/fundamentals/code-snippets/gridfs.go @@ -52,5 +52,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 }