Skip to content

fix(mongo): JSON filter cannot match ObjectId / DateTime fields - #861

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/783-mongo-json-filter
Sep 20, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/783-mongo-json-filter

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • Document list filter parses Extended JSON (\$oid, \$date) instead of plain json.decode.
  • A 24-character hex _id is wrapped as ObjectId.
  • If _id is still a string and find returns nothing, the empty state explains how to write { \"_id\": { \"\$oid\": \"…\" } }.

Test plan

  • Filter {\"_id\": \"<24-hex>\"} returns the document (not empty).
  • Filter {\"_id\": {\"\$oid\": \"<24-hex>\"}} matches.
  • Filter {\"created\": {\"\$date\": \"2024-01-15T12:30:00.000Z\"}} matches a DateTime field.
  • Filter {\"_id\": \"not-an-objectid\"} with no hits shows the ObjectId hint.

Closes #783

json.decode left _id as a string, so find never matched BSON ObjectId.
Accept $oid / $date and wrap a 24-character hex _id. Hint when a
string _id still matches nothing.
@github-actions github-actions Bot added bug Something isn't working frontend Theme parser epic label: frontend labels Sep 20, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit e63a575 into dev Sep 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Theme parser epic label: frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant