find with an Array does not find multiple non-ObjectId ids

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

       ruby
      Message.find [114869287646134350, 114869287646134398, 114869287646134388]
      
      Mongoid::Errors::DocumentNotFound: Document not found for class Message with id(s) 114869287646134350, 114869287646134398, 114869287646134388.
      from .../vendor/ruby/1.9.1/gems/mongoid-2.2.0/lib/mongoid/criterion/inclusion.rb:252:in `block in execute_or_raise'
      
       ruby
      [114869287646134350, 114869287646134398, 114869287646134388].map {|i| Message.find(i) }.map(&:id)
      => [114869287646134350, 114869287646134398, 114869287646134388]
      

      My guess is this has something to do with id being an integer instead of an ObjectId

              Assignee:
              Unassigned
              Reporter:
              gregwebs
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: