5

I am using maxmind node module to interact with the maxmind database. What I am trying to achieve is to get a list of all cities under specific state/country. The code is as follow.

var maxmind = require('maxmind');
maxmind.open('/path/to/GeoLite2-City.mmdb', (err, cityLookup) => {
   var city = cityLookup.get('66.6.44.4');
});

I dont think there is an option of listing all cities under state name.or search database via state/country name. Is there an alternative option ?

Adeel Tahir
  • 187
  • 2
  • 10

1 Answers1

1

This isn't possible. The database is designed to do lookups by IP address. I would suggest using the CSV files that MaxMind provides if you need to access the data in some other way.

Greg Oschwald
  • 1,716
  • 2
  • 11
  • 14