fix(mongodb): nested ObjectId(...) / ISODate(...) in MQL reach the server as {$oid} / {$date} maps
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Read lib/features/mongodb/mql_parser.dart to trace how nested Extended JSON wrappers become maps, then inspect mongo_ejson.dart for the existing conversion. Find where the query workspace passes parsed filters and documents, and add tests for nested ObjectId and ISODate values plus strings containing those expressions. Done means the nested values reach the query as BSON ObjectId and DateTime values while matching strings stay strings.
索引モデルが issue の本文から書いたものです。
説明
Problem
In the Mongo query workspace, ObjectId(...) and ISODate(...) nested inside a filter or document never become a BSON ObjectId or date:
db.users.find({ _id: ObjectId("5f1d7f0b9d3e2a0017a1b2c3") })
db.events.find({ at: { $gte: ISODate("2026-01-01") } })
db.users.insertOne({ owner: ObjectId("5f1d7f0b9d3e2a0017a1b2c3") })
MqlParser._normalizeJsObject (lib/features/mongodb/mql_parser.dart) turns them into Extended-JSON-shaped maps, {"$oid": "…"} and {"$date": "…"}, and json.decode keeps them as plain maps. Nothing on the MQL path converts them afterwards:
mongo_query_workspace.dartsendsMqlCommand.filter/documentas parsed;mongo_ejson.dart/mongo_field_codec.dart, which do understand$oid, are used by the document views, not here.
So the server receives {_id: {$oid: "…"}}:
- the
findabove matches nothing (or fails with an unknown-operator error, depending on the position); - an insert stores a sub-document
{ $oid: … }instead of an ObjectId.
Only a top-level argument that is itself ObjectId(...) / ISODate(...) is converted (MqlParser._parseRelaxedJson).
Noticed while fixing the normalizer in #1661 (#1513, #1539); not changed there.
Expected
After parsing, walk the filter / update / document / pipeline and convert Extended JSON wrappers into BSON values:
{"$oid": "<24 hex>"}→ObjectId;{"$date": "<ISO>"}→DateTime(UTC);- optionally
{"$numberLong": "…"}.
Reuse the conversion mongo_ejson.dart already has, so the document views and the query workspace agree.
Tests
find({ _id: ObjectId("…") })gives a filter whose_idis anObjectId;- an
ISODateinside$gteis aDateTime; insertOnewith a nestedObjectIdstores anObjectId;- a string that merely contains
ObjectId("…")stays a string.
- 主要言語
- Dart
- スター
- 23
- フォーク
- 1
- 平均マージ
- 31分
- マージ済み PR(30日)
- 570
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
QueryaHub/Querya-Desktop のほかの issue
-
enhancement ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
QueryaHub/Querya-Desktop#1689 ·
メンテナーはふだん 1 日以内に返信
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowオープンbug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
QueryaHub/Querya-Desktop#1642 ·
メンテナーはふだん 1 日以内に返信
-
bug error-handling settings
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
QueryaHub/Querya-Desktop#1637 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
QueryaHub/Querya-Desktop#1636 ·
メンテナーはふだん 1 日以内に返信
-
enhancement marketplace
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
QueryaHub/Querya-Desktop#1635 ·
メンテナーはふだん 1 日以内に返信
QueryaHub/Querya-Desktop の issue をすべて見る
似ている issue
-
good-first-issue P3
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
flutter/dart-intellij-third-party#758 ·
メンテナーはふだん 1 日以内に返信
-
Bug: Incorrect location coordinates on logged Sound Meter data対応中かも @Jashan32 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area/archive bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
DarkFlippers/qUnleashed#374 ·
メンテナーはふだん 1 日以内に返信
-
agent:in-progress agent:ready feature P2 · 中 区域: 悬浮窗
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
ASDW51/DanmuFloat#178 ·
メンテナーはふだん 1 日以内に返信
-
Missing workoutsオープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
InlitX/GymMane#237 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信