Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1781

Integer id and range searches

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: None
    • Labels:

      Description

      when having integer ids e.g.

      class Segment
        include Mongoid::Document  
        field :_id, :type => Integer
      end
      

      it should be possible to do:

      Segment.where(id: 3..14).count
      #and
      Segment.find( 3..5 ) 
      

      currently that gives a
      BSON::InvalidDocument: Cannot serialize an object of class Range (type 9) into BSON.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: