Hello,
I have my schema as below:
Const Game = new SimpleSchema({
moves:[String]
});
and using above I have my array in mongodb as:
{
“moves”: [
“e4”,
“y6”,
“f2”
]
}
Now I want to remove last element from above ‘moves’ array so I used:
GameCollection.update({ _id: Id }, { $pop: { moves: 1 } });
but, I’m getting an error with message: Internal Server Error(500) with an exception message like:
Exception while invoking method ‘execute-game-action’ { MongoError: Expected a number in: moves: “1”
Please guide.