Skip to content

Commit db0b67c

Browse files
committed
Dedupe direct/child roles in Auth pipline
1 parent e0fe49a commit db0b67c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/Auth.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,15 @@ Auth.prototype._generateRoleGraphPipeline = function () {
257257
},
258258
},
259259
},
260+
{
261+
$group: {
262+
_id: { name: '$name' },
263+
},
264+
},
260265
{
261266
$project: {
262-
name: 1,
267+
_id: 0,
268+
name: '$_id.name',
263269
},
264270
},
265271
],
@@ -284,9 +290,15 @@ Auth.prototype._generateRoleGraphPipeline = function () {
284290
},
285291
},
286292
},
293+
{
294+
$group: {
295+
_id: { name: '$name' },
296+
},
297+
},
287298
{
288299
$project: {
289-
name: 1,
300+
_id: 0,
301+
name: '$_id.name',
290302
},
291303
},
292304
],

0 commit comments

Comments
 (0)