lib/snapdb.js
function findStoresInZip(zip, callback) {
  var zip5 = typeof(zip) == 'string' ? parseInt(zip, 10) : zip;

  db.collection(stores, function(err, collection) {
    if (err) return callback(err);

    collection.find({zip5:zip5}).toArray(function(err, docs) {
      if (err) return callback(err);
      callback(null, docs);
    })
  })
}
function findStoresInZip(zip, callback) {
  var zip5 = typeof(zip) == 'string' ? parseInt(zip, 10) : zip;

  db.collection(stores, function(err, collection) {
    if (err) return callback(err);

    collection.find({zip5:zip5}).toArray(function(err, docs) {
      if (err) return callback(err);
      callback(null, docs);
    })
  })
}
function findStoresInZip ( zip , callback ) { var zip5 = typeof ( zip ) == 'string' ? parseInt ( zip , 10 ) : zip ; db . collection ( stores , function ( err , collection ) { if ( err ) return callback ( err ) ; collection . find ( { zip5 : zip5 } ) . toArray ( function ( err , docs ) { if ( err ) return callback ( err ) ; callback ( null , docs ) ; } ) } ) }
Find all the stores within a zip code.
Find all the stores within a zip code .