I'm using Restangular to connect with Mongolab. I'd like to use the following code to push an update:
var theData = {"$push":{exercises :{type: "running"}}};
Restangular.all('employees').one(user._id.$oid).customPUT(theData ,null, {apiKey: apiKey});
When I run this and look at the XHR request, the payload is always set to {}.
However, if I pull out the $, my payload looks like this:
{"push":{exercises :{type: "running"}}}
In that instance, the payload looks fine, but mongolab thinks I'm wanting to add a field named "push" instead of pushing to the excercises array since I'm not using the "$push" keyword.
I can have the "$" anywhere in the string except at the front (e.g " $push" and "push$" work) but unfortunately, that's what mongo requires in order to push an update. Is there some setting that I'm missing, or is this a bug in restangular?