Skip to content

Conflate CommandOptions into [Collection|Table]FindManyOptions for Find#180

Merged
sl-at-ibm merged 10 commits into
mainfrom
SL-issue179-commandOptions-for-Find
May 11, 2026
Merged

Conflate CommandOptions into [Collection|Table]FindManyOptions for Find#180
sl-at-ibm merged 10 commits into
mainfrom
SL-issue179-commandOptions-for-Find

Conversation

@sl-at-ibm
Copy link
Copy Markdown
Collaborator

@sl-at-ibm sl-at-ibm commented May 7, 2026

Fixes #179 .

Fixes #166 .
(while we're at it...)

Fixes #185 as well.

Specifically it adds a single overload with all three parameters, likely enough for the (probably uncommon) case of users who want to set options to the cursor.
Update: changed to use a single options parameter that now also includes the CommandOptions stuff.

Along the way, a little restructuring of the xmldocs is done (now it's uniformly structured).

Also a basic test is added to check the options do indeed make their way to the fecth-page executions.

Note: changes like this would require a duplicate test on tables to really test everything. Note for the future: expand test coverage, since not everything about find is in the shared Abstract/Cursor classes.

@sl-at-ibm sl-at-ibm requested a review from toptobes May 7, 2026 13:04
@sl-at-ibm sl-at-ibm changed the title support CommandOptions in Find method Conflate CommandOptions into [Collection|Table]FindManyOptions for Find May 8, 2026
@sl-at-ibm
Copy link
Copy Markdown
Collaborator Author

The latest direction of this PR is to avoid two 'options' parameters and have the very FindManyOptions class(es) extend CommandOptions to capture all options.

This required a bit of machinery between the various classes involved, which should be considered as there's the potential for mistakes such as forgetting to add a new CommandOptions field in one of the 'extraction' and clone methods:

  • No explicit constructors, so this should be ok and futureproof
  • The *FindManyOptions' Clone method now lists all the CmdOpts properties explicitly
  • Introduced a .CommandOptions() method that extracts that part, and a .PayloadOptions() method that extracts that other part. These seem necessary to feed the right thing to the right parts of the logic to construct the find Command's
    • well, not strictly necessary maybe but I thuoght it cleaner and centralized.
    • indeed, the [JsonIgnore] had to be added to the CommandOptions members to avoid them leaking into the find payload! (which does not seem to have adverse consequences anywhere). We don't want e.g. the token to leak by mistake or something like that, and creating a specific class for the "find payload options" can always be done later.

@sl-at-ibm sl-at-ibm force-pushed the SL-issue179-commandOptions-for-Find branch from fe8faf5 to f7db234 Compare May 8, 2026 21:59
@sl-at-ibm
Copy link
Copy Markdown
Collaborator Author

I'm completing this PR with the conflation of CommandOptions into InsertManyOptions as well.

  • removed some InsertMany[Async] signatures. Now it's only (docs) and (docs,options) (i.e. docs/rows)

  • methods' xmldocs made uniform (which tags appear where, etc)

  • methods' xmldocs phrasing slightly reworked

  • (renamed the static const MaxConcurrency to DefaultConcurrency in the options)

  • removed the guard that prevented inserting an empty list of docs/rows

  • added test (coll+table) about passing a generic 'command options' setting

(@skedwards88 this is possibly reflected somewhere in the docs?)

@toptobes toptobes added this pull request to the merge queue May 11, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 11, 2026
@sl-at-ibm sl-at-ibm added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit 8295da8 May 11, 2026
7 checks passed
@sl-at-ibm sl-at-ibm deleted the SL-issue179-commandOptions-for-Find branch May 11, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants