I am trying to write a Meteor front end to an AWS service. All goes well until I try to insert or update the collection with json data received from an AWS api call. The data I’m interested in exists in an array in the json returned returned by the API call. To insert/update the collection I have to loop through the array to get to the element, so it looks something like this:
for (var i=0, len=data.Reservations.length; i<len; i++) {
AWS_INSTANCES.insert(data.Reservations[i].Instances);
}
which yields the following error: Error: Mongo selector can’t be an array.
I’ve tried various different approaches without any success. Any help would be greatly appreciated.
Thanks.