我使用带有mongoidgem的rails3.2.3作为mongodb数据库。我有以下代码但是,当发布的用户名与任何文档的用户名不匹配时,此代码会给出错误。The search was for the id(s): 5010cdc81d41c8d30b0000405 ... (1 total) and the following ids were notResolution: Search for an id that is
/mongoid-3.0.4/lib/mongoid/persistence/operations/insert.rb:26:in `persist'
from /app/vendor/bundle/ruby/1.9.1/gems/mongoid-3.0.4/lib/mongoid/persistence.rb:50:in `insert'