简体   繁体   中英

Maxmind list all cities in a state

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM