-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Tests
The following tests fail against 4.1/4.2 servers:
1) Mongoid::Criteria#geo_near returns the matching documents Failure/Error: @results ||= client.command(command).first Mongo::Error::OperationFailure: no such command: 'geoNear' (59) # ./lib/mongoid/contextual/geo_near.rb:263:in `results' # ./lib/mongoid/contextual/geo_near.rb:245:in `documents' # ./lib/mongoid/contextual/geo_near.rb:39:in `each' # ./lib/mongoid/contextual/geo_near.rb:10:in `entries' # ./lib/mongoid/contextual/geo_near.rb:10:in `==' # ./spec/mongoid/criteria_spec.rb:1009:in `block (3 levels) in <top (required)>' 2) Mongoid::Criteria#max_scan executes the criteria while properly giving the max scan to Mongo Failure/Error: super Mongo::Error::OperationFailure: Failed to parse: { find: "bands", filter: {}, maxScan: 1, $db: "mongoid_test", $clusterTime: { clusterTime: Timestamp(1547443824, 16), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } }, lsid: { id: UUID("2ca9b8a0-2a88-48cc-a38f-a61be03f99a0") } }. Unrecognized field 'maxScan'. (9) # ./lib/mongoid/query_cache.rb:224:in `each' # ./lib/mongoid/contextual/mongo.rb:134:in `each' # ./lib/mongoid/contextual.rb:21:in `each' # ./spec/mongoid/criteria_spec.rb:3354:in `to_a' # ./spec/mongoid/criteria_spec.rb:3354:in `block (3 levels) in <top (required)>'
Note that no Mongoid code changes are needed for server 4.2 support, however some of the tests need to be skipped on 4.2+ servers because they exercise functionality that was removed in server 4.2.