fix(mongodb): nested ObjectId(...) / ISODate(...) in MQL reach the server as {$oid} / {$date} maps
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Dart
- Estrellas
- 23
- Forks
- 1
- Merge medio
- 31 min
- PR fusionados (30 d)
- 570
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de QueryaHub/Querya-Desktop
-
enhancement ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Los mantenedores suelen responder en 1 día
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbiertobug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Los mantenedores suelen responder en 1 día
-
bug error-handling settings
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Los mantenedores suelen responder en 1 día
-
enhancement marketplace
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Los mantenedores suelen responder en 1 día
Todos los issues de QueryaHub/Querya-Desktop
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
atsign-foundation/at_server#2896 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
lugassawan/swe-workbench#823 ·
Los mantenedores suelen responder en 1 día
-
auto-implement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bannzai/kashakeibo#142 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Images copied with `adb push` don't show in the wallpaper picker ("No images found on device")Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
meddouribadis/arclauncher#53 ·
Los mantenedores suelen responder en 1 día
-
p: material_ui package team-design
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
flutter/flutter#195096 · 1 comentario ·
Los mantenedores suelen responder en 1 día