gridfs tests
This commit is contained in:
parent
81d1e7bc3b
commit
b4b4f289dd
16
tests/mongo-qa/gridfs_in
Normal file
16
tests/mongo-qa/gridfs_in
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require File.join(File.dirname(__FILE__), '_common.rb')
|
||||
|
||||
require 'mongo/gridfs'
|
||||
include XGen::Mongo::GridFS
|
||||
|
||||
db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)
|
||||
|
||||
input_file = ARGV[0]
|
||||
|
||||
File.open(input_file, "r") { |f|
|
||||
GridStore.open(db, input_file, "w") { |g|
|
||||
g.write(f.read)
|
||||
}
|
||||
}
|
17
tests/mongo-qa/gridfs_out
Normal file
17
tests/mongo-qa/gridfs_out
Normal file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require File.join(File.dirname(__FILE__), '_common.rb')
|
||||
|
||||
require 'mongo/gridfs'
|
||||
include XGen::Mongo::GridFS
|
||||
|
||||
db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)
|
||||
|
||||
input_file = ARGV[0]
|
||||
output_file = ARGV[1]
|
||||
|
||||
File.open(output_file, "w") { |f|
|
||||
GridStore.open(db, input_file, "r") { |g|
|
||||
f.write(g.read)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user