Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
88eccfa
RUBY-3209 Generate api docs (#2768)
comandeo-mongo Aug 7, 2023
ae75857
RUBY-3308 Fixing serverless test failures (#2770)
jamis Aug 14, 2023
b36d358
RUBY-3314 Implement variable iterations for benchmarks (#2771)
jamis Aug 17, 2023
6e88e3e
RUBY-3313 Record benchmark percentiles (#2772)
jamis Aug 21, 2023
5598035
RUBY-3315 BSON benchmark scoring (#2773)
jamis Aug 22, 2023
c303ab6
RUBY-3242 Add spec tests for runCommand (#2776)
comandeo-mongo Aug 25, 2023
42f7838
RUBY-2748 Retry reads/writes on another mongos (#2717)
comandeo-mongo Aug 25, 2023
f447d09
RUBY-3316 Quality of life updates for BSON benchmarks (#2774)
jamis Aug 28, 2023
765976a
RUBY-3268 search index management helpers (#2777)
jamis Sep 7, 2023
d3b3d6b
RUBY-3324 bump drivers-evergreen-tools to get updated atlas setup/tea…
jamis Sep 13, 2023
70c23a9
RUBY-3328 add `execution` expansion to environment for atlas cluster …
jamis Sep 18, 2023
17e4ec4
RUBY-3372 Fix failing explain tests (#2782)
comandeo-mongo Sep 18, 2023
70e5f38
RUBY-3279 Bump min server version for FLE test (#2779)
comandeo-mongo Sep 18, 2023
b1f9faf
RUBY-3267 make specs pass when X.509 authentication is active (#2781)
jamis Sep 19, 2023
49f0046
RUBY-2706 Test find related options (#2789)
comandeo-mongo Oct 5, 2023
4b007a6
RUBY-3331: Inline server lifecycle callout (#2790)
alexbevi Oct 6, 2023
b6549ac
RUBY-3296 Write to log when non-genuine host is detected (#2791)
jamis Oct 11, 2023
cb21f01
RUBY-3149 Test on AWS Lambda (#2800)
comandeo-mongo Oct 20, 2023
014a50f
Fix serverless tests (#2802)
comandeo-mongo Oct 31, 2023
16a2095
RUBY-3333 Update AWS auth tests (#2803)
comandeo-mongo Nov 2, 2023
79dba06
RUBY-3347 add additional serverless project to tests (#2810)
jamis Nov 21, 2023
ba527e1
Fix broken link in Mongo::Monitoring::Event::Secure (#2775)
alexbevi Nov 28, 2023
829cd5a
RUBY-3341 Document error handling in transactions (#2809)
comandeo-mongo Dec 5, 2023
0b29297
RUBY-3365 remove spec (#2820)
jamis Jan 9, 2024
20d16a7
RUBY-3362 sync specs to fix failing tests on server version 7.3 (#2819)
jamis Jan 9, 2024
95e1752
RUBY-3361 resync specs (#2818)
jamis Jan 9, 2024
756f67e
RUBY-3298 Add container info to handshake metadata (#2821)
jamis Jan 12, 2024
488fce0
RUBY-1813 Discard ServerSessions involved in network errors (#2825)
jamis Jan 15, 2024
0d99359
RUBY-3329 Connection String: make delimiting slash between hosts and …
jamis Jan 15, 2024
b7acff4
RUBY-2254 sort by id when comparing collection contents (#2823)
jamis Jan 15, 2024
aaa2a56
RUBY-1791 Raise if transactions not supported (#2822)
comandeo-mongo Jan 15, 2024
72cf221
RUBY-3358 Handle nil session is write_worker (#2826)
comandeo-mongo Jan 19, 2024
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
Prev Previous commit
Next Next commit
RUBY-2706 Test find related options (#2789)
* 2706

* Add unified test for all find options

* Add missing options

* Clarify collation on collection

* Add tests for read_concern option

* Add tests for read_preference option
  • Loading branch information
comandeo-mongo committed Jan 24, 2024
commit 49f0046fff8be5e536221416b262f8f94b5c4edd
4 changes: 3 additions & 1 deletion lib/mongo/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ def capped?
# inserted or updated documents where the clustered index key value
# matches an existing value in the index.
# - *:name* -- Optional. A name that uniquely identifies the clustered index.
# @option opts [ Hash ] :collation The collation to use.
# @option opts [ Hash ] :collation The collation to use when creating the
# collection. This option will not be sent to the server when calling
# collection methods.
# @option opts [ Hash ] :encrypted_fields Hash describing encrypted fields
# for queryable encryption.
# @option opts [ Integer ] :expire_after Number indicating
Expand Down
1 change: 1 addition & 0 deletions lib/mongo/collection/view/iterable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def initial_query_op(session)
let: options[:let],
limit: limit,
allow_disk_use: options[:allow_disk_use],
allow_partial_results: options[:allow_partial_results],
read: read,
read_concern: options[:read_concern] || read_concern,
batch_size: batch_size,
Expand Down
41 changes: 2 additions & 39 deletions spec/integration/find_options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,10 @@
[ SpecConfig.instance.addresses.first ]
end

let(:client_options) do
{}
end

let(:collection_options) do
{}
end

let(:client) do
ClientRegistry.instance.new_local_client(
seeds,
SpecConfig.instance.test_options
.merge(database: SpecConfig.instance.test_db)
.merge(client_options)
SpecConfig.instance.test_options.merge(client_options)
).tap do |client|
client.subscribe(Mongo::Monitoring::COMMAND, subscriber)
end
Expand All @@ -40,11 +30,8 @@
subscriber.started_events.find { |cmd| cmd.command_name == 'find' }
end

let(:should_create_collection) { true }

before do
client['find_options'].drop
collection.create if should_create_collection
ClientRegistry.instance.global_client('authorized')['find_options'].drop
collection.insert_many([ { a: 1 }, { a: 2 }, { a: 3 } ])
end

Expand Down Expand Up @@ -84,8 +71,6 @@
{ 'locale' => 'de_AT' }
end

let(:should_create_collection) { false }

it 'uses the collation defined on the collection' do
collection.find({}, collation: collation).to_a
expect(find_command.command['collation']).to eq(collation)
Expand Down Expand Up @@ -202,26 +187,4 @@
end
end
end

describe 'cursor type' do
let(:collection_options) do
{ capped: true, size: 1000 }
end

context 'when cursor type is :tailable' do
it 'sets the cursor type to tailable' do
collection.find({}, cursor_type: :tailable).first
expect(find_command.command['tailable']).to be true
expect(find_command.command['awaitData']).to be_falsey
end
end

context 'when cursor type is :tailable_await' do
it 'sets the cursor type to tailable' do
collection.find({}, cursor_type: :tailable_await).first
expect(find_command.command['tailable']).to be true
expect(find_command.command['awaitData']).to be true
end
end
end
end
12 changes: 12 additions & 0 deletions spec/runners/unified/crud_operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ def get_find_view(op)
if session = args.use('session')
opts[:session] = entities.get(:session, session)
end
if collation = args.use('collation')
opts[:collation] = collation
end
if args.key?('noCursorTimeout')
opts[:no_cursor_timeout] = args.use('noCursorTimeout')
end
if args.key?('oplogReplay')
opts[:oplog_replay] = args.use('oplogReplay')
end
if args.key?('allowPartialResults')
opts[:allow_partial_results] = args.use('allowPartialResults')
end
req = collection.find(args.use!('filter'), **opts)
if batch_size = args.use('batchSize')
req = req.batch_size(batch_size)
Expand Down
Loading