The Database Hub | Back4App
The Database Hub | Back4App
How it works
  • Log In
  • Sign Up

  1. Back4App
  2. World Continents, Countries, and Cities
Public

1210
6436
1210
  • DatabaseDatabase
  • GraphQL API PlaygroundAPI Playground
  • Get Started GuideGet Started
  • IssuesIssues
  • ContributorsContributors
  • Database
    Database
    GraphQL API Playground
    API Playground
    Get Started Guide
    Get Started
    Contributors
    Contributors

  1. IssueOpen
  2. No relationn of Cities with Subdivision or Country

New IssueNew

sharifskhans commented this issue on Aug 2020

How you are maintaining the relationship of cities with Subdivision?

Another one issue while generating data for Cities getting issue as stream has large amount of data around more than 1.3 million. Is there any parameter(range parameter) by which we can get the records.

Well you people have done a great job.

Thanks, Sharif Khan

alexb4a.br commented this issue on Aug 2020

Hey sharifskhans! The database is provided "as is" so any maintenance of relationships are being done by its collaborators. If you wish you can become one and help maintain everything up to date. You can limit the number of retrieved results using the limit method, which will retrieve the specific number of records, or, if you are paginating the results, you can also use the skip method together with the limit, so you can retrieve the exact page of records you need.

sharifskhans commented this issue on Aug 2020

@Alexb4a.br Thanks for the response, you mean to say or if not it should Skipping and limit means, If want to get the data and we have 1.4 million records from 1.2 million to 1.35 million then we can pass Skip=1.19 million and limit = 2 million then we should get 1.21 million to 1.4 million records.

But its not working as it should work like.

And will surely help.

Thanks,

alexb4a.br commented this issue on Aug 2020

You probably shouldn't retrieve as many results at once, as it will probably take a lot of time to process and deliver everything. What you can do is to retrieve paginated results, let's say, in a 100 records per page. Also, you can use the "select" method to retrieve only the columns you are going to use. This ensures you won't retrieve data that will not be used, and make everything faster. So, a query like that would be (in Javascript):

const query = new Parse.Query("Cities"); const count = await query.count(); const myLimit = 100; query.limit(myLimit); for (let page = 0; page < (count/myLimit); page++){ query.skip(page * myLimit); query.select('name', 'code'); let results = await query.find(); }

Something like that. I did not test this code, but something very similar should work.

Please enter a comment for this issue.