Is it possible to list all files in given GridFS directory using ruby mongo driver? I've searched through documentatio开发者_高级运维n and have not found anything satisfying. What is more I cannot find any way to search files by metadata too. I have checked java driver's documentation and both of these functionalities are available out of the box using GridFS class.
Best regards,
Michał
grid = Mongo::Grid.new(Mongoid.database)
files = grid.instance_variable_get :@files
files.find("filename" => "uploads/143-normal_regular2.jpg").as_json
# files.remove - deletes alle files
same works for chunks
精彩评论