Skip to content

Commit 75b54d9

Browse files
committed
minor: updated GridFS examples
1 parent 3c79c64 commit 75b54d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/gridfs.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def assert
1717
grid = Grid.new(db)
1818

1919
# Write a new file. data can be a string or an io object responding to #read.
20-
id = grid.put(data, 'hello.txt')
20+
id = grid.put(data, :filename => 'hello.txt')
2121

2222
# Read it and print out the contents
2323
file = grid.get(id)
@@ -33,11 +33,12 @@ def assert
3333
end
3434

3535
# Metadata
36-
id = grid.put(data, 'hello.txt', :content_type => 'text/plain', :metadata => {'name' => 'hello'})
36+
id = grid.put(data, :filename => 'hello.txt', :content_type => 'text/plain', :metadata => {'name' => 'hello'})
3737
file = grid.get(id)
3838

3939
p file.content_type
4040
p file.metadata.inspect
4141
p file.chunk_size
4242
p file.file_length
43+
p file.filename
4344
p file.data

0 commit comments

Comments
 (0)