It may be a really stupid question, but I'm new to MongoDB, so bear with me. I created a separate ruby ββclass:
require 'rubygems' require 'mongo' require 'bson' require 'mongo_mapper' MongoMapper.database = "testing" class Twit include MongoMapper::Document key :id, Integer, :unique => true key :screen_name, String, :unique => true ...
Then I do the following with irb
>> twit = Twit.all.first => #<Twit _id: BSON::ObjectId('4df2d4a0c251b2754c000001'), id: 21070755, screen_name: "bguestSB"> >> twit.destroy => true >> Twit.all => [#<Twit _id: BSON::ObjectId('4df2d4a0c251b2754c000001'), id: 21070755, screen_name: "bguestSB">]
So how can I destroy documents in MongoDB? What am I doing wrong?
source share