Hi,
I am going crazy over this problem, so I really hope someone can help me.
What I am trying to do is add to a user’s record (using MongoDB).
Here is a sample from my mongo user table:
updated: ISODate(“2016-06-14T11:16:59.102Z”),
objectId: “b3e24e99b1”
name: “David S”,
country: “AU”,
orders: [
{
drinkName: “Beer”,
cost: “50”,
date: “1 Jan”
},
{
drinkName: “Whisky”,
cost: “20”,
date: “2 Jan”
},
{
drinkName: “Cocktail”,
cost: “40”,
date: “4 Jan”""
}
]
As you can see I have a table of “orders”. I want to be able to add a new drinkName/cost/date (i.e. an order) to this list (obviously when an event occurs such as payment made etc). All I can see in the API doc’s is the mc:updateUser function. So when I implement this:
mc:updateUser( {orders = {drinkName = Beer, cost = “50” }}, function(event) end)
It REPLACES and updates the information rather than ADDING a new record to my orders list.
Can someone please advise,
Thanks!!