Currently, I'm developing an API with sails js + mongoDB for an mobile app. I want to save multiple data that send from mobile app and I catch it via req parameters (as object) in my controller's function.
Some parts of my controller code look like this :
var contactData = req.allParams().Contact;
looping.. {
Contact.create(contactData[index]).exec(function addContact(err,createdContact){ });
}
Could you tell me how the best way to implement looping for save that multiple contact data to the database?
Regards, argi danu.