Graphql Mutation with multiple selector(using AND operand in where clause)

Hi All,
I want to update an object using graphql mutation where i want to pass multiple clauses in where condition.there will be AND operation.
Please see below my query and see where clause.

mutation {
  updatePoll(
    input: {
      **where: { id: "5f4cda0bbc293802c23fa506",Opt3Count: 99}**
      data: { Opt3Count: 100 }
    }
  ) 
  {
    poll {
      id
      Opt3Count
    }
  }

But it is not supported…getting error.how can i do it?
Please suggest asap.

If you are passing in the id then the extra where clause shouldn’t matter as you are specifically targeting an entry in the database. I don’t believe that Mongo (our implementation of services on mongo, not mongo itself) supports passing in bulk updates, meaning you need to specifically target an entry with an ID.

Hi @DMehaffy,
Thanks for your reply.
Its fine and makes sense to update an object by passing only id and its enough for an object to get updated.
But my requirement is quite different.Let me explain it for you.
I have structure for polls and there is a count field in polls which holds the number.now i am going to update its value for 4 which is 3 right now and simultaneously another person is giving vote at same time and here if my update works by passing id then it will be 4 …fine …but that’s person’s vote will again update the value to 4 by passing same id,which should not be.It should be 5 …here if my desired filter would have worked then update would have been failed for another user and again another update from 4 to 5 would have been called …here i want to do the AND filter saying that do update only if id matches and count is certain value,then update with my value else do not update.
That’s why i needed the above query.

The client shouldn’t be dictating the count, the server should. This would require usage of the model lifecycles (which I’m not sure work with GQL, will have to test), or customizing the resolver.

If you want an absolute method, you cron a count cron script (either built in or external) that regularly updates the count. But the user making the query shouldn’t dictate this.

i am having the same issue how can i update my product quantity endpoint when a user purchase an item