-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
When ordering by created_at page 2 of a geospatial query contains results from page 1:
class Bar include Mongoid::Document include Mongoid::Timestamps field :location, type: Array index :'location' => "2d" def self.run_test #error does not always show up in first iteration for i in 1..100 Bar.delete_all puts "it number " + i.to_s for j in 1..100 Bar.create(:location => [10,10]) end test = Bar.near(:'location' => [10,10]).order_by( :'created_at'.asc ).page(1).per(2) test1_ids = [] test.each do |tst| test1_ids << tst.id end test2 = Bar.near(:'location' => [10,10]).order_by( :'created_at'.asc ).page(2).per(2) test2_ids = [] test2.each do |tst| test2_ids << tst.id end if ( test1_ids & test2_ids ).length > 0 raise "unexpected duplicate elements:" + ( test1_ids & test2_ids ).to_json end end end end