How do I drop a Grid object with the Ruby Mongo Driver?
I do drop from the shell, because it treats GridFS as collections, but how do I do it with Ruby?
2 Answers
Are you trying to remove a single file or the entire GridFS collections? the grid_file_system supports deleting by filename. Otherwise you can manually drop the collections (I think fs.files and fs.chunks by default)
1 Comment
ma11hew28
I want to remove the entire GridFS collections by calling a method like
remove on the Ruby Grid object, but I guess that's not possible. Looks like I'll have to create Collection objects for each of the collections that make up the GridFS and call remove on both of them.Grids it's just to collections: files and chunks. So just drop these two collections.
I am not familiar with ruby but mb this link will be useful for you.