We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14f6f69 commit 4963ab9Copy full SHA for 4963ab9
spec/mongoid/criteria/queryable/selectable_logical_spec.rb
@@ -2093,5 +2093,27 @@
2093
end
2094
2095
2096
+
2097
+ # This test confirms that MONGOID-5097 has been repaired.
2098
+ context "when using exists on a field of type Time" do
2099
+ let(:criteria) do
2100
+ Dictionary.any_of({:published.exists => true}, published: nil)
2101
+ end
2102
2103
+ it "doesn't raise an error" do
2104
+ expect do
2105
+ criteria
2106
+ end.to_not raise_error
2107
2108
2109
+ it "generates the correct selector" do
2110
+ expect(criteria.selector).to eq({
2111
+ "$or" => [ {
2112
+ "published" => { "$exists" => true }
2113
+ }, {
2114
+ "published" => nil
2115
+ } ] } )
2116
2117
2118
2119
0 commit comments