MongoDB remove GridFS objects from shell
You want to use db.fs.delete(_id);
instead.
Update Sorry, that apparently doesn't work from the shell, only through the driver. GridFS is a specification for storage implemented by the drivers. Looks like it doesn't have much built-in functionality from the shell, as such.
Update 2 There is also a command line tool, mongofiles (http://www.mongodb.org/display/DOCS/GridFS+Tools), which allows you to delete files by name. mongofiles delete <filename>
. It comes with a warning that it will delete all of the files by that name, so it's not as granular as by id.
You can delete gridFS file by deleting both chunks and files from shell. for example
db['fs.chunks'].remove({files_id:my_id});
db['fs.files'].remove({_id:my_id});
Those commands will do such trick.