开发者

Listing files in GridFS directory using Ruby driver

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜