Sign In Register

How can we help you today?

Start a new topic
Answered

modifying values of 1 document only in a runtime collection

im definitely just stupid but I cant figure this out.


I finally have a turn based card game made, and the match joining and leaving works, and I just need to store how many cards are left each turn.


all the example go over using multiple docs per player in a collection, but I want 1 doc per match.


I know that should be as simple but i just cant get it to work. 



image

image


image

image



Best Answer

Hi Adam,


Like in the other forum post, this can be solved by wrapping the second argument to update in a $set operator.

{$set: {"cardsLeft":cardsLeft}}


-Pádraig

1 Comment

Answer

Hi Adam,


Like in the other forum post, this can be solved by wrapping the second argument to update in a $set operator.

{$set: {"cardsLeft":cardsLeft}}


-Pádraig

Login to post a comment