Skip to content

Instantly share code, notes, and snippets.

@Pitbi
Created September 17, 2012 19:54
Show Gist options
  • Save Pitbi/3739403 to your computer and use it in GitHub Desktop.
Save Pitbi/3739403 to your computer and use it in GitHub Desktop.
var drivers = xml.find("//Driver");
drivers.forEach(function (driver) {
var driverName = "" + driver.get("Name").text();
var laps = driver.find("Lap");
Driver.findOne({name : driverName}).exec(function (err, driverFound) {
if (driverFound != null) {
laps.forEach(function (lap) {
console.log(lap.attr);
lap.attr.forEach(function (lapAttribute) {
console.log(lapAttribute.value());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment