Skip to content
Discussion options

You must be logged in to vote

Got it! Thank you guys!

return getCollection()
      .aggregate(
        Arrays.asList(
          new Document("$match",
            new Document("badges.categorieId", categorieId)
              .append("badges.subcategorieId", subCategorieId)
              .append("_id", jwt.getSubject())),
          new Document("$project",
            new Document("badges",
              new Document("$filter",
                new Document("input", "$badges")
                  .append("as", "badges")
                  .append("cond",
                    new Document("$eq", Arrays.asList("$$badges.subCategorieId", subCategorieId)))))))
      )

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@loicmathieu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by nextNluwi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
3 participants