Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mongo/server/description.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Description
# Fields to exclude when comparing two descriptions.
#
# @since 2.0.6
EXCLUDE_FOR_COMPARISON = [ LOCAL_TIME ].freeze
EXCLUDE_FOR_COMPARISON = [ LOCAL_TIME, LAST_WRITE ].freeze

# @return [ Address ] address The server's address.
attr_reader :address
Expand Down
6 changes: 5 additions & 1 deletion spec/mongo/server/description_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'maxWireVersion' => 2,
'minWireVersion' => 0,
'localTime' => Time.now,
'lastWrite' => { 'lastWriteDate' => Time.now },
'ok' => 1
}
end
Expand Down Expand Up @@ -838,7 +839,10 @@
end

let(:other) do
described_class.new(address, replica.merge('localTime' => 1))
described_class.new(address, replica.merge(
'localTime' => 1,
'lastWrite' => { 'lastWriteDate' => 1 }
))
end

it 'excludes certain fields' do
Expand Down