Skip to content

Commit

Permalink
Fix incorrect id fields in empty nested results with MongoDB
Browse files Browse the repository at this point in the history
`id` was returned instead of `_id` because of the wrong method being
called. This bug was previously masked by serialization logic silently
filtering out unknown fields before `.zip()`, making the rest of the
fields mismatch the corresponding values, which wasn't a problem in this
case because there are no values in an empty result.
  • Loading branch information
aqrln committed Jan 22, 2024
1 parent cd42686 commit 412bf40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion query-engine/query-structure/src/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl ManyRecords {
pub fn empty(selected_fields: &FieldSelection) -> Self {
Self {
records: Vec::new(),
field_names: selected_fields.prisma_names().collect(),
field_names: selected_fields.db_names().collect(),
}
}

Expand Down

0 comments on commit 412bf40

Please sign in to comment.