Skip to content

fix(mongodb): return all stored fields from search for CF/PG parity (+ README parity)#63

Merged
techiejd merged 3 commits into
mainfrom
docs/adapters-readme-mongodb-parity
Jun 6, 2026
Merged

fix(mongodb): return all stored fields from search for CF/PG parity (+ README parity)#63
techiejd merged 3 commits into
mainfrom
docs/adapters-readme-mongodb-parity

Conversation

@techiejd

@techiejd techiejd commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Brings MongoDB to parity with the PG/CF adapters: a real search behavior fix, plus the contract README cleanup.

Code: search now returns all stored fields (CF/PG parity)

Mongo search projected only the reserved fields plus filterableFields, silently dropping stored extension fields that weren't marked filterable — diverging from findByIds (which returns all non-reserved fields) and from the CF/PG adapters, whose search returns all stored fields. Now fetches all fields except the embedding vector ($addFields score + $project: { embedding: 0 }) and maps every non-reserved field. The heavy vector stays excluded, so only the small extension fields that were missing now round-trip. Resolves the review finding that findByIds and search returned different field sets for the same record.

  • New spec: a non-filterable stored field is returned by search.
  • Mongo suite green (107 tests); build typechecks clean.

Docs: adapters/README parity cleanup

  • Quick-links: add the MongoDB package link alongside pg and cf.
  • Feature parity table: add a MongoDB column (real-time + bulk ingest ✅; where full; like regex ✅; no migration bin — runtime ensureSearchIndex; score range = vectorSearchScore).
  • Fix a false CF claim: the table said both pg and CF pass vectorSearchWhere.spec.ts, but CF's where coverage lives in where.spec.ts (59 tests). Now stated accurately per-adapter.

Based on main (latest merged in: #61 cf-workers-types, #64/#65 defer-validation, #66 version-packages).

techiejd added 3 commits June 1, 2026 13:56
Mongo search projected only the reserved fields plus filterableFields, so
stored extension fields that weren't marked filterable were silently dropped
from results — diverging from findByIds (which returns all non-reserved
fields) and from the CF/PG adapters (whose search returns all stored fields).

Fetch all fields except the embedding vector ($addFields score + $project
{ embedding: 0 }) and map every non-reserved field. The heavy embedding stays
excluded, so only the small extension fields that were missing now round-trip.

Adds a spec asserting a non-filterable stored field is returned by search.
@techiejd techiejd changed the title docs: adapters/README MongoDB parity cleanup fix(mongodb): return all stored fields from search for CF/PG parity (+ README parity) Jun 6, 2026
@techiejd techiejd merged commit a7f43f5 into main Jun 6, 2026
8 checks passed
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