Question: How would I compute using MongoDB the number of different station_ids for each borough and then order them by decreasing number of station_ids, and in

How would I compute using MongoDB the number of different station_ids for each borough and then order them by decreasing number of station_ids, and in case of tie, by increasing order in the borough name??

The dataset is taken from the New York City Bike Sharing System.

The data elements look like this.

How would I compute using MongoDB the number of different station_ids for

_id: ObjectId("682d6b759cd3dd3114a53a9a") time: "2019/05/02 80:00:00" station_id: 150 station_name: "E 2 St &; Avenue" station_status: "In Service" latitude: 40.7208736 longitude: -73.98085795 zipcode: 10009 borough: "Manhattan" neighbourhood: "Alphabet City" available_bikes: 52 available_docks: id: objectId("602d6b759cd3dd3114a53a9b") time: "2019/05/02 00:00:00" station_id: 2003 station_name: "1 Ave &; E 18 st" station_status: "In Service" latitude: 40.73381219 longitude: -73.98054421 zipcode: 18009 borough: "Manhattan" neighbourhood: "Stuyvesant Town-Peter Cooper Village" available_bikes: 50 available_docks: 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!