Skip to content
Discussion options

You must be logged in to vote

The filtered positional operator $[identifier] is working:

return getCollection().updateOne(
      eq("_id", "xyz"),
      Updates.combine(
        Updates.inc("badges.$[badges].count", 1)
      ),
      new UpdateOptions()
        .arrayFilters(Arrays.asList(
          and(
            eq("badges.categorieId", "menu2"),
            eq("badges.subCategorieId", "1")
          ))));

But shouldn't the other method also work?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
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
1 participant