Skip to content

Commit 27e4a50

Browse files
committed
fix dump query
1 parent 225dd77 commit 27e4a50

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

src/api/commons/queries/structures.dump.query.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ export default [
1010
_id: 0,
1111
id: 1,
1212
displayName: '$currentName.usualName',
13-
href: { $concat: ['/structures/', '$id'] },
14-
identifiers: 1,
13+
identifiers: { $ifNull: ['$identifiers', []] },
1514
},
1615
},
1716
];

src/jobs/dump/structures.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const relationGroupQuery = [
125125
{
126126
$lookup: {
127127
from: 'relationgroups',
128-
localField: '$relationsGroupId',
128+
localField: 'relationsGroupId',
129129
foreignField: 'id',
130130
pipeline: [
131131
{
@@ -180,16 +180,6 @@ const relationResourceQuery = [
180180
...resourceLookup,
181181
...relationTypeQuery,
182182
...relationGroupQuery,
183-
{
184-
$lookup: {
185-
from: 'relationtypes',
186-
localField: 'relationTypeId',
187-
foreignField: 'id',
188-
pipeline: relationTypesLightQuery,
189-
as: 'relationType',
190-
},
191-
},
192-
{ $set: { relationType: { $arrayElemAt: ['$relationType', 0] } } },
193183
{
194184
$project: {...projection, resource: 1 },
195185
},

0 commit comments

Comments
 (0)