Skip to content

fix(database,functions): custom endpoint CONTAIN op and PUT route mapping#1503

Merged
kkopanidis merged 2 commits into
mainfrom
fix/bug-batch-database-functions
Jun 21, 2026
Merged

fix(database,functions): custom endpoint CONTAIN op and PUT route mapping#1503
kkopanidis merged 2 commits into
mainfrom
fix/bug-batch-database-functions

Conversation

@kkopanidis

@kkopanidis kkopanidis commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Custom endpoint comparison operation 8 was documented as array-contains but generated the same $nin query as operation 7, so filters never matched documents whose array fields include a value. Functions declared with inputs.method: 'PUT' also registered as GET routes because getOperation only handled the UPDATE alias.

  • Remove the erroneous op 8 $nin branch so CONTAIN uses the default direct-equality query
  • Treat PUT the same as UPDATE when registering function routes

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other (please describe)

Does this PR introduce a breaking change?

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the main branch
  • When resolving a specific issue, it's referenced in the PR's description

Test plan

  • Create a custom endpoint with an array field filter using comparison op 8 and confirm matching documents are returned (op 7 with the same value should still use exclusion semantics)
  • Register a request function with inputs.method: 'PUT' and confirm the router exposes PUT on the function path
  • Send an HTTP PUT to that function path and confirm the handler runs; GET on the same path should not invoke the PUT handler

…ping

Restore CONTAIN comparison semantics for custom endpoints and map PUT
function inputs to UPDATE routes instead of falling through to GET.
@kkopanidis
kkopanidis force-pushed the fix/bug-batch-database-functions branch from 6efeeb5 to 5cba8f3 Compare June 21, 2026 15:34
Op 8 already matches default array-contains semantics; remove the
erroneous $nin branch instead of duplicating the default arm.
@kkopanidis
kkopanidis merged commit b7a8e40 into main Jun 21, 2026
7 checks passed
@kkopanidis
kkopanidis deleted the fix/bug-batch-database-functions branch June 21, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant