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

Mongoize Range endpoints + support begin-less/end-less ranges

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 8.0.1
    • Affects Version/s: None
    • Component/s: Query
    • None
    • Minor Change

      class User
        include Mongoid::Document
        include Mongoid::Attributes::Dynamic
        include Mongoid::Timestamps::Created
      end
      User.where(created_at: Date.today.at_beginning_of_day..Date.today.end_of_day).to_a
      # => 
      # MONGODB | 127.0.0.1:27017 | in_app_push_development.find | STARTED | {"find"=>"live_chats", "filter"=>{"visited_at"=>{"$gte"=>Mon, 24 May 2021 00:00:00 CST +08:00, "$lte"=>Mon, 24 May 2021 23:59:59 CST +08:00}}, "sort"=>{"_id"=>1}, "limit"=>1, "singleBatch"=>true, "lsid"=>{"id"=><BSON::Binary:0x2307063220 type=uuid data=0xb255e333ac134930...>}}
      
      User.where(dynamic_column: Date.today.at_beginning_of_day..Date.today.end_of_day).to_a
      # => 
      # demo.find | STARTED | {"find"=>"users", "filter"=>{"dynamic_column"=>{"$gte"=>Mon, 24 May 2021 00:00:00 CST +08:00, "$lte"=>Mon, 24 May 2021 23:59:59 CST +08:00}}, "lsid"=>{"id"=><BSON::Binary:0x2293638920 type=uuid data=0xce4728f87e384555...>}}
      

      I want dynamic_column also use UTC time

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            fengqingqing1992@gmail.com 向阳 徐
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: