I am using Mongoose npm module to manage mongodb. This is schema of mongodb collection what I am going to update.
var UserSchema = new Schema({ username:
If you just want to update cards based on cardIndex:
User.update({_id: userID}, {'$set': { 'cards.cardIndex': cardInfo }}, function(err) { //code }