我成功地使用了 MongoMapper 对原子“$push”和“$set”的内置支持,但无法弄清楚“$pull”
class Feed
include MongoMapper::Document
many :stories
end
class Story
include MongoMapper::EmbeddedDocument
key :title, String
end
feed = Feed.first
story = Story.new(:title => "Hello, world!")
Feed.push(feed.id, :stories => story.to_mongo) #works fine
Feed.set({:_id => feed.id, "stories.title" => "Hello, world!"}, "stories.$.title" => "Foo") #works fine
Feed.pull( ??? )
如何使用拉取原子地删除故事?