Validation object must have at least one operator / meteor mongo

后端 未结 2 1961
慢半拍i
慢半拍i 2021-01-19 03:11

I wrote a method to a user\'s address to a collection. However, i keep getting the error:

When the modifier option is true, validation object must have at le         


        
2条回答
  •  无人共我
    2021-01-19 04:05

    Try the following code:

    Meteor.users.update(
      {$currUserId}, 
      {$addToSet:
        {'address.streetAddress': addressDetails.streetAddress,
         'address.city': addressDetails.city,
         'address.state': addressDetails.state,
         'address.zipCode': addressDetails.zipCode
        }
    });
    

提交回复
热议问题