I have several records with a unique identifier that I want to drop after the form has performed it's ajax post. Let's assume I have 5 records in my goinstant storage and the common field is xkey and the value in it contains 123*. My question is how can I remove multiple keys cleanly? Any examples would be tremendously helpful.
Slukeheart has the correct answer with best practice in mind: I found a working solution as well, but I'm giving the correct answer credit to Slukeheart. This is what I found to work at the same time as the solution was posted today:
$.ajax({
url: './angtest',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({ model: mymodelobj }),
success: function (result) {
//handleData(result);
//remove old record entries to prevent table bloat.
$scope.person = $goQuery('person', { xkey: @Html.Raw(json.Encode(ViewBag.xkey1)) }, { limit: 30 }).$sync();
$scope.person.$on('ready', function () {
var tokill = $scope.person.$omit();
angular.forEach(tokill, function(person,key) {
$scope.person.$key(key).$remove();
})
});
}
});