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 eb88df6 commit 2e2b5a1Copy full SHA for 2e2b5a1
lib/mongo/collection/view/readable.rb
@@ -138,7 +138,7 @@ def count(options = {})
138
cmd[:limit] = options[:limit] if options[:limit]
139
cmd[:maxTimeMS] = options[:max_time_ms] if options[:max_time_ms]
140
read_with_retry do
141
- database.command(cmd, options).n
+ database.command(cmd, options).n.to_i
142
end
143
144
spec/mongo/collection/view/readable_spec.rb
@@ -227,6 +227,10 @@
227
it 'returns the count of matching documents' do
228
expect(view.count).to eq(1)
229
230
+
231
+ it 'returns an integer' do
232
+ expect(view.count).to be_a(Integer)
233
+ end
234
235
236
context 'when no selector is provided' do
0 commit comments