small medium large xlarge

Generic-user-small
16 Feb 2012, 06:31
Alex Varju (2 posts)

There are a couple of errors in update_area.js. @phone.number._id@ is not a valid field, and the wrong collection is specified when saving.

I think the function should actually be:

update_area = function() {
  db.phones.find().forEach(
	  function(phone) {
      phone.components.area++;
      phone.display = "+"+
        phone.components.country+" "+
        phone.components.area+"-"+
        phone.components.number;
      db.phones.update({ _id : phone._id }, phone, false);
    }
  )
}
25233_377319146748_591736748_3799641_97127_n_pragsmall
22 Mar 2012, 20:08
Eric Redmond (21 posts)

thanks. fixed for final version.

You must be logged in to comment