Introduction to MongoDB Coursera Quiz Answers – Networking Funda

All Weeks Introduction to MongoDB Coursera Quiz Answers

This course will get you up and running with MongoDB quickly, and teach you how to leverage its power for data analytics.

We’ll start by mastering the fundamentals of MongoDB, including MongoDB’s Document data model, importing data into a cluster, working with our CRUD API and Aggregation Framework.

These topics will be taught through a demo application which will give you a great first encounter of how simple and practical it can be to build applications with MongoDB. In addition to these essential topics, you will also learn and work with useful MongoDB tools and services.

You will work with Atlas, MongoDB’s database as a service, MongoDB Compass, a schema visualization tool, as well as many other useful command-line utilities.

Enroll on Coursera

Introduction to MongoDB Week 01 Quiz Answers

Quiz 1: Creating an Atlas Free-Tier Cluster

Q1. How much will our Atlas cluster cost per month?

  • 20 USD
  • 1 USD
  • Nothing. It’s free.
  • 10 USD
  • 5 USD

Quiz 2: Getting Data Into MongoDB

Q1. How many documents were imported by our mongoimport command?

  • 40,001
  • 46,014
  • 46,000
  • 44,800
  • 40,600

Quiz 3: Using Compass to View Data in an Atlas Cluster

Q1. What is the runtime of the first document listed in our collection?

  • 1 min
  • 6 min
  • 23 min
  • 14 min
  • 103 min

Quiz 4: Working with Data in MongoDB

Q1. Which of the following accurately describe PyMongo?

  • A library that supports the MongoDB aggregation framework and query language
  • A Python library
  • A client library for connecting to MongoDB
  • A hosting platform for MongoDB
  • A programming language

Quiz 5: How to Connect to Your Atlas Cluster from Python

Q1. What elements of the provided connection string do you need to change in order to successfully connect to MongoDB from Python?

  • database
  • password
  • username
  • cluster name
  • authorization source

Quiz 6: Connecting to Atlas

Q1. In this assessment, you’re going to connect it to our course cluster. You’ll use the course cluster for several of the assignments throughout this course. For some of the assessments you’ll use your own Atlas cluster, so keep this in mind when passing your connection URI to pymongo.

Before attempting this assessment make sure you’ve followed all of the instructions in the Setting Up Your Course Environment reading.

Once your course environment is set up, you can then download the attached notebook and open it in Jupyter: connecting-to-atlas.ipynb.

This notebook is designed to verify that you’ve successfully set up your course environment and that you’re able to connect to MongoDB Atlas.

Citibike is New York’s bike share system. The notebook queries a collection of Citibike user trip data. Each document represents a trip that someone made on a Citibike bike and looks something like this:

{
"_id": ObjectId("572bb8222b288919b68adfa5"),
"tripduration": null,
"start station id": 279,
"start station name": "Peck Slip & Front St",
"end station id": 268,
"end station name": "Howard St & Centre St",
"bikeid": 22820,
"usertype": "Customer",
"birth year": "",
"gender": 0,
"start station location": {
"type": "Point",
"coordinates": [
-74.00167,
40.707873
]
},
"end station location": {
"type": "Point",
"coordinates": [
-73.99973337,
40.71910537
]
},
"start time": ISODate("2016-01-01T17:19:38Z"),
"stop time": ISODate("2016-01-01T17:29:42Z")
}

The notebook queries MongoDB to find all trips between 5 and 10 minutes in duration that start at station 216.

Execute each cell in the notebook, by pressing shift-enter in a given cell. How many trips were printed in the last cell?

from pymongo import MongoClient # this lets us connect to MongoDB
import pprint # this lets us print our MongoDB documents nicely

# the connection uri to our course cluster
client = MongoClient('mongodb://analytics-student:[email protected]:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin')

# the trips collection on the citibike database
trips = client.citibike.trips

# find all trips between 5 and 10 minutes in duration that start at station 216
query = {"tripduration":{"$gte":5000,"$lt":10000},"start station id":216}

# only return the bikeid, tripduration, and _id (displayed by default)
projection = {"bikeid": 1, "tripduration": 1}
# print all of the trips
for doc in trips.find(query, projection):
    pprint.pprint(doc)
    
print(len(list(trips.find(query))))
{'_id': ObjectId('572bb8262b288919b68ce62f'),
 'bikeid': 15947,
 'tripduration': 5294}
{'_id': ObjectId('572bb8262b288919b68ce62b'),
 'bikeid': 23539,
 'tripduration': 5296}
{'_id': ObjectId('572bb8282b288919b68e2f73'),
 'bikeid': 14936,
 'tripduration': 6753}
{'_id': ObjectId('572bb8362b288919b6957859'),
 'bikeid': 15996,
 'tripduration': 7532}
{'_id': ObjectId('572bb8362b288919b6957856'),
 'bikeid': 22463,
 'tripduration': 7528}
{'_id': ObjectId('572bb83c2b288919b698a8a5'),
 'bikeid': 20123,
 'tripduration': 5758}
{'_id': ObjectId('572bb83c2b288919b698a8a9'),
 'bikeid': 15904,
 'tripduration': 5760}
{'_id': ObjectId('572bb8432b288919b69c213a'),
 'bikeid': 19549,
 'tripduration': 5293}
{'_id': ObjectId('572bb8432b288919b69c211e'),
 'bikeid': 16960,
 'tripduration': 6318}
{'_id': ObjectId('572bb8432b288919b69c2192'),
 'bikeid': 18922,
 'tripduration': 8778}
{'_id': ObjectId('572bb8432b288919b69c2193'),
 'bikeid': 17275,
 'tripduration': 8777}
11

Quiz 7: Intro to the Aggregation Framework

Q1. Which of the following are true of the aggregation pipeline?

  • Pipelines use a MongoDB collection as input.
  • Aggregation pipelines are similar to Linux shell pipelines.
  • An individual stage within a pipeline performs many different types of tasks.
  • You may include a particular type of stage in an aggregation pipeline only once.
  • The task a pipeline stage performs is tunable.

Quiz 8: Your First Aggregation (Using $group)

Q1. What data structure is used to define expressions in the aggregation framework?

  • string
  • dictionary
  • tuple
  • list
  • int

Quiz 9: Incremental Improvements with $sort and $sortByCount

Q1. What are the two components of a sort expression?

  • direction
  • field
  • list
  • count
  • size

Quiz10 : Analyzing Data with Aggregation

Q1. In this assessment, you’re going to combine several of the aggregation concepts that you learned in this chapter to answer a question about the Citibike dataset.

Go ahead and download the notebook attached and open it in Jupyter: analyzing-data-with-aggregation.

Every Citibike trip has a start and end station. In the trips collection, each document has a start station id and an end station id representing these stations.

Your task is to build an aggregation pipeline in cell 4 of the notebook to answer the following question: Citibike trips that start at station id 279 end most frequently at what station id?

To verify that you’ve successfully completed this exercise enter your answer below.

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pymongo\n",
    "import pprint"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "client = pymongo.MongoClient('mongodb://analytics-student:[email protected]:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ragini/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:1: DeprecationWarning: database_names is deprecated. Use list_database_names instead.\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['100YWeatherSmall',\n",
       " 'admin',\n",
       " 'aggregations',\n",
       " 'citibike',\n",
       " 'city',\n",
       " 'config',\n",
       " 'coursera-agg',\n",
       " 'local',\n",
       " 'mflix',\n",
       " 'results',\n",
       " 'ships',\n",
       " 'video']"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "client.database_names()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = client.citibike"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ragini/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:1: DeprecationWarning: collection_names is deprecated. Use list_collection_names instead.\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "['trips']"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.collection_names()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [],
   "source": [
    "d = data.trips"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ragini/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:1: DeprecationWarning: count is deprecated. Use estimated_document_count or count_documents instead. Please note that $where must be replaced by $expr, $near must be replaced by $geoWithin with $center, and $nearSphere must be replaced by $geoWithin with $centerSphere\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1990273"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "trips = client.citibike.trips"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'_id': ObjectId('572bb8452b288919b69d46db'),\n",
      " 'bikeid': 18662,\n",
      " 'birth year': 1967,\n",
      " 'end station id': 268,\n",
      " 'end station location': {'coordinates': [-73.99973337, 40.71910537],\n",
      "                          'type': 'Point'},\n",
      " 'end station name': 'Howard St & Centre St',\n",
      " 'gender': 1,\n",
      " 'start station id': 279,\n",
      " 'start station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                            'type': 'Point'},\n",
      " 'start station name': 'Peck Slip & Front St',\n",
      " 'start time': datetime.datetime(2016, 3, 28, 17, 44, 28),\n",
      " 'stop time': datetime.datetime(2016, 3, 28, 17, 56, 33),\n",
      " 'tripduration': 725,\n",
      " 'usertype': 'Subscriber'}\n",
      "{'_id': ObjectId('572bb8452b288919b69d4696'),\n",
      " 'bikeid': 18662,\n",
      " 'birth year': 1967,\n",
      " 'end station id': 279,\n",
      " 'end station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                          'type': 'Point'},\n",
      " 'end station name': 'Peck Slip & Front St',\n",
      " 'gender': 1,\n",
      " 'start station id': 279,\n",
      " 'start station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                            'type': 'Point'},\n",
      " 'start station name': 'Peck Slip & Front St',\n",
      " 'start time': datetime.datetime(2016, 3, 27, 14, 58, 27),\n",
      " 'stop time': datetime.datetime(2016, 3, 27, 15, 9, 26),\n",
      " 'tripduration': 658,\n",
      " 'usertype': 'Subscriber'}\n",
      "{'_id': ObjectId('572bb8452b288919b69d4658'),\n",
      " 'bikeid': 18662,\n",
      " 'birth year': 1970,\n",
      " 'end station id': 264,\n",
      " 'end station location': {'coordinates': [-74.00731853, 40.70706456],\n",
      "                          'type': 'Point'},\n",
      " 'end station name': 'Maiden Ln & Pearl St',\n",
      " 'gender': 1,\n",
      " 'start station id': 279,\n",
      " 'start station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                            'type': 'Point'},\n",
      " 'start station name': 'Peck Slip & Front St',\n",
      " 'start time': datetime.datetime(2016, 3, 26, 16, 32, 23),\n",
      " 'stop time': datetime.datetime(2016, 3, 26, 16, 37, 11),\n",
      " 'tripduration': 288,\n",
      " 'usertype': 'Subscriber'}\n",
      "{'_id': ObjectId('572bb8452b288919b69d46cd'),\n",
      " 'bikeid': 18662,\n",
      " 'birth year': 1985,\n",
      " 'end station id': 279,\n",
      " 'end station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                          'type': 'Point'},\n",
      " 'end station name': 'Peck Slip & Front St',\n",
      " 'gender': 2,\n",
      " 'start station id': 279,\n",
      " 'start station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                            'type': 'Point'},\n",
      " 'start station name': 'Peck Slip & Front St',\n",
      " 'start time': datetime.datetime(2016, 3, 28, 17, 21, 5),\n",
      " 'stop time': datetime.datetime(2016, 3, 28, 17, 22, 20),\n",
      " 'tripduration': 75,\n",
      " 'usertype': 'Subscriber'}\n",
      "{'_id': ObjectId('572bb8452b288919b69d46d2'),\n",
      " 'bikeid': 18662,\n",
      " 'birth year': '',\n",
      " 'end station id': 224,\n",
      " 'end station location': {'coordinates': [-74.00552427, 40.71146364],\n",
      "                          'type': 'Point'},\n",
      " 'end station name': 'Spruce St & Nassau St',\n",
      " 'gender': 0,\n",
      " 'start station id': 279,\n",
      " 'start station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                            'type': 'Point'},\n",
      " 'start station name': 'Peck Slip & Front St',\n",
      " 'start time': datetime.datetime(2016, 3, 28, 17, 25, 4),\n",
      " 'stop time': datetime.datetime(2016, 3, 28, 17, 30, 35),\n",
      " 'tripduration': 330,\n",
      " 'usertype': 'Customer'}\n",
      "{'_id': ObjectId('572bb8452b288919b69d4699'),\n",
      " 'bikeid': 18662,\n",
      " 'birth year': 1984,\n",
      " 'end station id': 279,\n",
      " 'end station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                          'type': 'Point'},\n",
      " 'end station name': 'Peck Slip & Front St',\n",
      " 'gender': 1,\n",
      " 'start station id': 279,\n",
      " 'start station location': {'coordinates': [-74.00167, 40.707873],\n",
      "                            'type': 'Point'},\n",
      " 'start station name': 'Peck Slip & Front St',\n",
      " 'start time': datetime.datetime(2016, 3, 27, 16, 22, 2),\n",
      " 'stop time': datetime.datetime(2016, 3, 27, 16, 29, 24),\n",
      " 'tripduration': 441,\n",
      " 'usertype': 'Subscriber'}\n"
     ]
    }
   ],
   "source": [
    "for i in trips.find():\n",
    "    '$sort' :{'end station name':-1,'bikeid':-1}\n",
    "    pprint.pprint(i)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Replace XXXX with your aggregation pipeline to answer the question:\n",
    "# Citibike trips that start at station id 279 end most frequently at what station id?\n",
    "pipeline = [\n",
    "\n",
    "    {\n",
    "        '$sortByCount' :{'$mergeObjects': [\"$end station name\",\"$bikeid\"] }\n",
    "    },\n",
    "    {\n",
    "        '$limit' : 3\n",
    "    }\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [],
   "source": [
    "pipeline = [\n",
    "    {\"$limit\":1000},\n",
    "    {\n",
    "    '$group' : {\n",
    "        '_id' : {\"end station id\" : \"$end station id\",\"bikeid\":\"$bikeid\"},\n",
    "        \n",
    "        'count':{\"$sum\":1}\n",
    "\n",
    "    }},\n",
    "        {\n",
    "        '$sort': { 'count':-1}\n",
    "        }\n",
    "    \n",
    "]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'_id': {'bikeid': 23599, 'end station id': 3147}, 'count': 3}\n",
      "{'_id': {'bikeid': 24290, 'end station id': 351}, 'count': 2}\n",
      "{'_id': {'bikeid': 17373, 'end station id': 2006}, 'count': 2}\n",
      "{'_id': {'bikeid': 17467, 'end station id': 528}, 'count': 2}\n",
      "{'_id': {'bikeid': 16585, 'end station id': 3104}, 'count': 2}\n",
      "{'_id': {'bikeid': 19740, 'end station id': 459}, 'count': 1}\n",
      "{'_id': {'bikeid': 22270, 'end station id': 2002}, 'count': 1}\n",
      "{'_id': {'bikeid': 22642, 'end station id': 2003}, 'count': 1}\n",
      "{'_id': {'bikeid': 17345, 'end station id': 507}, 'count': 1}\n",
      "{'_id': {'bikeid': 20901, 'end station id': 363}, 'count': 1}\n",
      "{'_id': {'bikeid': 22441, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 19761, 'end station id': 128}, 'count': 1}\n",
      "{'_id': {'bikeid': 23784, 'end station id': 446}, 'count': 1}\n",
      "{'_id': {'bikeid': 20860, 'end station id': 250}, 'count': 1}\n",
      "{'_id': {'bikeid': 17079, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 23067, 'end station id': 229}, 'count': 1}\n",
      "{'_id': {'bikeid': 16645, 'end station id': 396}, 'count': 1}\n",
      "{'_id': {'bikeid': 23970, 'end station id': 476}, 'count': 1}\n",
      "{'_id': {'bikeid': 20533, 'end station id': 3090}, 'count': 1}\n",
      "{'_id': {'bikeid': 21222, 'end station id': 521}, 'count': 1}\n",
      "{'_id': {'bikeid': 22933, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 19943, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 18158, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 23872, 'end station id': 331}, 'count': 1}\n",
      "{'_id': {'bikeid': 22874, 'end station id': 401}, 'count': 1}\n",
      "{'_id': {'bikeid': 23746, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 23847, 'end station id': 281}, 'count': 1}\n",
      "{'_id': {'bikeid': 16102, 'end station id': 403}, 'count': 1}\n",
      "{'_id': {'bikeid': 15881, 'end station id': 515}, 'count': 1}\n",
      "{'_id': {'bikeid': 16292, 'end station id': 295}, 'count': 1}\n",
      "{'_id': {'bikeid': 21666, 'end station id': 355}, 'count': 1}\n",
      "{'_id': {'bikeid': 19912, 'end station id': 411}, 'count': 1}\n",
      "{'_id': {'bikeid': 23366, 'end station id': 282}, 'count': 1}\n",
      "{'_id': {'bikeid': 23968, 'end station id': 2003}, 'count': 1}\n",
      "{'_id': {'bikeid': 14789, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 22756, 'end station id': 223}, 'count': 1}\n",
      "{'_id': {'bikeid': 23130, 'end station id': 253}, 'count': 1}\n",
      "{'_id': {'bikeid': 16222, 'end station id': 3164}, 'count': 1}\n",
      "{'_id': {'bikeid': 23211, 'end station id': 3169}, 'count': 1}\n",
      "{'_id': {'bikeid': 18031, 'end station id': 500}, 'count': 1}\n",
      "{'_id': {'bikeid': 23144, 'end station id': 466}, 'count': 1}\n",
      "{'_id': {'bikeid': 17057, 'end station id': 401}, 'count': 1}\n",
      "{'_id': {'bikeid': 20843, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 19380, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 19574, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 23490, 'end station id': 295}, 'count': 1}\n",
      "{'_id': {'bikeid': 23148, 'end station id': 363}, 'count': 1}\n",
      "{'_id': {'bikeid': 23526, 'end station id': 546}, 'count': 1}\n",
      "{'_id': {'bikeid': 23320, 'end station id': 2008}, 'count': 1}\n",
      "{'_id': {'bikeid': 14665, 'end station id': 528}, 'count': 1}\n",
      "{'_id': {'bikeid': 24133, 'end station id': 521}, 'count': 1}\n",
      "{'_id': {'bikeid': 18527, 'end station id': 3074}, 'count': 1}\n",
      "{'_id': {'bikeid': 16086, 'end station id': 403}, 'count': 1}\n",
      "{'_id': {'bikeid': 17554, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 22820, 'end station id': 484}, 'count': 1}\n",
      "{'_id': {'bikeid': 23839, 'end station id': 329}, 'count': 1}\n",
      "{'_id': {'bikeid': 21467, 'end station id': 3120}, 'count': 1}\n",
      "{'_id': {'bikeid': 15750, 'end station id': 490}, 'count': 1}\n",
      "{'_id': {'bikeid': 24168, 'end station id': 2010}, 'count': 1}\n",
      "{'_id': {'bikeid': 23420, 'end station id': 508}, 'count': 1}\n",
      "{'_id': {'bikeid': 23099, 'end station id': 445}, 'count': 1}\n",
      "{'_id': {'bikeid': 14943, 'end station id': 2021}, 'count': 1}\n",
      "{'_id': {'bikeid': 20197, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 17002, 'end station id': 401}, 'count': 1}\n",
      "{'_id': {'bikeid': 17451, 'end station id': 336}, 'count': 1}\n",
      "{'_id': {'bikeid': 14535, 'end station id': 225}, 'count': 1}\n",
      "{'_id': {'bikeid': 19426, 'end station id': 282}, 'count': 1}\n",
      "{'_id': {'bikeid': 23809, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 16069, 'end station id': 332}, 'count': 1}\n",
      "{'_id': {'bikeid': 22083, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 23298, 'end station id': 301}, 'count': 1}\n",
      "{'_id': {'bikeid': 19841, 'end station id': 2003}, 'count': 1}\n",
      "{'_id': {'bikeid': 22351, 'end station id': 511}, 'count': 1}\n",
      "{'_id': {'bikeid': 20348, 'end station id': 3170}, 'count': 1}\n",
      "{'_id': {'bikeid': 19323, 'end station id': 301}, 'count': 1}\n",
      "{'_id': {'bikeid': 22644, 'end station id': 437}, 'count': 1}\n",
      "{'_id': {'bikeid': 14957, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 14808, 'end station id': 375}, 'count': 1}\n",
      "{'_id': {'bikeid': 16743, 'end station id': 2010}, 'count': 1}\n",
      "{'_id': {'bikeid': 19509, 'end station id': 401}, 'count': 1}\n",
      "{'_id': {'bikeid': 22813, 'end station id': 521}, 'count': 1}\n",
      "{'_id': {'bikeid': 14886, 'end station id': 391}, 'count': 1}\n",
      "{'_id': {'bikeid': 15627, 'end station id': 362}, 'count': 1}\n",
      "{'_id': {'bikeid': 22764, 'end station id': 3092}, 'count': 1}\n",
      "{'_id': {'bikeid': 15443, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 23592, 'end station id': 388}, 'count': 1}\n",
      "{'_id': {'bikeid': 23140, 'end station id': 3224}, 'count': 1}\n",
      "{'_id': {'bikeid': 16152, 'end station id': 3143}, 'count': 1}\n",
      "{'_id': {'bikeid': 20901, 'end station id': 263}, 'count': 1}\n",
      "{'_id': {'bikeid': 16564, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 23677, 'end station id': 432}, 'count': 1}\n",
      "{'_id': {'bikeid': 20746, 'end station id': 503}, 'count': 1}\n",
      "{'_id': {'bikeid': 22909, 'end station id': 279}, 'count': 1}\n",
      "{'_id': {'bikeid': 17959, 'end station id': 495}, 'count': 1}\n",
      "{'_id': {'bikeid': 24142, 'end station id': 3110}, 'count': 1}\n",
      "{'_id': {'bikeid': 19543, 'end station id': 412}, 'count': 1}\n",
      "{'_id': {'bikeid': 19173, 'end station id': 167}, 'count': 1}\n",
      "{'_id': {'bikeid': 20693, 'end station id': 325}, 'count': 1}\n",
      "{'_id': {'bikeid': 18488, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 23645, 'end station id': 263}, 'count': 1}\n",
      "{'_id': {'bikeid': 21443, 'end station id': 3110}, 'count': 1}\n",
      "{'_id': {'bikeid': 21165, 'end station id': 393}, 'count': 1}\n",
      "{'_id': {'bikeid': 23445, 'end station id': 494}, 'count': 1}\n",
      "{'_id': {'bikeid': 23987, 'end station id': 356}, 'count': 1}\n",
      "{'_id': {'bikeid': 18232, 'end station id': 3111}, 'count': 1}\n",
      "{'_id': {'bikeid': 23566, 'end station id': 446}, 'count': 1}\n",
      "{'_id': {'bikeid': 23647, 'end station id': 529}, 'count': 1}\n",
      "{'_id': {'bikeid': 22665, 'end station id': 357}, 'count': 1}\n",
      "{'_id': {'bikeid': 23702, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 24503, 'end station id': 3141}, 'count': 1}\n",
      "{'_id': {'bikeid': 22112, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 18008, 'end station id': 268}, 'count': 1}\n",
      "{'_id': {'bikeid': 18871, 'end station id': 195}, 'count': 1}\n",
      "{'_id': {'bikeid': 20871, 'end station id': 3177}, 'count': 1}\n",
      "{'_id': {'bikeid': 16240, 'end station id': 513}, 'count': 1}\n",
      "{'_id': {'bikeid': 15828, 'end station id': 509}, 'count': 1}\n",
      "{'_id': {'bikeid': 23092, 'end station id': 495}, 'count': 1}\n",
      "{'_id': {'bikeid': 21698, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 18058, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 14980, 'end station id': 317}, 'count': 1}\n",
      "{'_id': {'bikeid': 16870, 'end station id': 3173}, 'count': 1}\n",
      "{'_id': {'bikeid': 21117, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 23882, 'end station id': 3090}, 'count': 1}\n",
      "{'_id': {'bikeid': 23704, 'end station id': 470}, 'count': 1}\n",
      "{'_id': {'bikeid': 23095, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 15428, 'end station id': 79}, 'count': 1}\n",
      "{'_id': {'bikeid': 23706, 'end station id': 259}, 'count': 1}\n",
      "{'_id': {'bikeid': 23156, 'end station id': 3076}, 'count': 1}\n",
      "{'_id': {'bikeid': 15684, 'end station id': 368}, 'count': 1}\n",
      "{'_id': {'bikeid': 23853, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 16780, 'end station id': 526}, 'count': 1}\n",
      "{'_id': {'bikeid': 16500, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 20850, 'end station id': 531}, 'count': 1}\n",
      "{'_id': {'bikeid': 19539, 'end station id': 540}, 'count': 1}\n",
      "{'_id': {'bikeid': 19809, 'end station id': 3142}, 'count': 1}\n",
      "{'_id': {'bikeid': 23139, 'end station id': 116}, 'count': 1}\n",
      "{'_id': {'bikeid': 23426, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 23113, 'end station id': 2004}, 'count': 1}\n",
      "{'_id': {'bikeid': 15023, 'end station id': 116}, 'count': 1}\n",
      "{'_id': {'bikeid': 17751, 'end station id': 352}, 'count': 1}\n",
      "{'_id': {'bikeid': 20030, 'end station id': 164}, 'count': 1}\n",
      "{'_id': {'bikeid': 18982, 'end station id': 3143}, 'count': 1}\n",
      "{'_id': {'bikeid': 18716, 'end station id': 377}, 'count': 1}\n",
      "{'_id': {'bikeid': 20946, 'end station id': 3224}, 'count': 1}\n",
      "{'_id': {'bikeid': 19424, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 22777, 'end station id': 3153}, 'count': 1}\n",
      "{'_id': {'bikeid': 15106, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 23890, 'end station id': 432}, 'count': 1}\n",
      "{'_id': {'bikeid': 18138, 'end station id': 295}, 'count': 1}\n",
      "{'_id': {'bikeid': 18372, 'end station id': 128}, 'count': 1}\n",
      "{'_id': {'bikeid': 24100, 'end station id': 476}, 'count': 1}\n",
      "{'_id': {'bikeid': 15470, 'end station id': 250}, 'count': 1}\n",
      "{'_id': {'bikeid': 15277, 'end station id': 457}, 'count': 1}\n",
      "{'_id': {'bikeid': 22599, 'end station id': 401}, 'count': 1}\n",
      "{'_id': {'bikeid': 16175, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 21171, 'end station id': 403}, 'count': 1}\n",
      "{'_id': {'bikeid': 20101, 'end station id': 530}, 'count': 1}\n",
      "{'_id': {'bikeid': 23706, 'end station id': 284}, 'count': 1}\n",
      "{'_id': {'bikeid': 21018, 'end station id': 3150}, 'count': 1}\n",
      "{'_id': {'bikeid': 22147, 'end station id': 229}, 'count': 1}\n",
      "{'_id': {'bikeid': 18064, 'end station id': 358}, 'count': 1}\n",
      "{'_id': {'bikeid': 22145, 'end station id': 356}, 'count': 1}\n",
      "{'_id': {'bikeid': 16514, 'end station id': 3075}, 'count': 1}\n",
      "{'_id': {'bikeid': 20006, 'end station id': 3224}, 'count': 1}\n",
      "{'_id': {'bikeid': 15986, 'end station id': 482}, 'count': 1}\n",
      "{'_id': {'bikeid': 18030, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 20202, 'end station id': 329}, 'count': 1}\n",
      "{'_id': {'bikeid': 20860, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 19571, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 20664, 'end station id': 445}, 'count': 1}\n",
      "{'_id': {'bikeid': 23532, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 19036, 'end station id': 3242}, 'count': 1}\n",
      "{'_id': {'bikeid': 16502, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 22181, 'end station id': 363}, 'count': 1}\n",
      "{'_id': {'bikeid': 19945, 'end station id': 526}, 'count': 1}\n",
      "{'_id': {'bikeid': 23136, 'end station id': 489}, 'count': 1}\n",
      "{'_id': {'bikeid': 23301, 'end station id': 521}, 'count': 1}\n",
      "{'_id': {'bikeid': 22919, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 22295, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 17306, 'end station id': 345}, 'count': 1}\n",
      "{'_id': {'bikeid': 16216, 'end station id': 504}, 'count': 1}\n",
      "{'_id': {'bikeid': 16383, 'end station id': 521}, 'count': 1}\n",
      "{'_id': {'bikeid': 16400, 'end station id': 3074}, 'count': 1}\n",
      "{'_id': {'bikeid': 20733, 'end station id': 368}, 'count': 1}\n",
      "{'_id': {'bikeid': 22060, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 22715, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 18131, 'end station id': 212}, 'count': 1}\n",
      "{'_id': {'bikeid': 19702, 'end station id': 486}, 'count': 1}\n",
      "{'_id': {'bikeid': 15374, 'end station id': 540}, 'count': 1}\n",
      "{'_id': {'bikeid': 20107, 'end station id': 152}, 'count': 1}\n",
      "{'_id': {'bikeid': 17322, 'end station id': 518}, 'count': 1}\n",
      "{'_id': {'bikeid': 20864, 'end station id': 490}, 'count': 1}\n",
      "{'_id': {'bikeid': 16496, 'end station id': 487}, 'count': 1}\n",
      "{'_id': {'bikeid': 16884, 'end station id': 379}, 'count': 1}\n",
      "{'_id': {'bikeid': 22642, 'end station id': 312}, 'count': 1}\n",
      "{'_id': {'bikeid': 21252, 'end station id': 472}, 'count': 1}\n",
      "{'_id': {'bikeid': 16540, 'end station id': 350}, 'count': 1}\n",
      "{'_id': {'bikeid': 19125, 'end station id': 336}, 'count': 1}\n",
      "{'_id': {'bikeid': 16514, 'end station id': 3090}, 'count': 1}\n",
      "{'_id': {'bikeid': 18025, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 23016, 'end station id': 253}, 'count': 1}\n",
      "{'_id': {'bikeid': 19810, 'end station id': 3143}, 'count': 1}\n",
      "{'_id': {'bikeid': 21481, 'end station id': 513}, 'count': 1}\n",
      "{'_id': {'bikeid': 23677, 'end station id': 439}, 'count': 1}\n",
      "{'_id': {'bikeid': 23494, 'end station id': 295}, 'count': 1}\n",
      "{'_id': {'bikeid': 22713, 'end station id': 332}, 'count': 1}\n",
      "{'_id': {'bikeid': 15817, 'end station id': 251}, 'count': 1}\n",
      "{'_id': {'bikeid': 16216, 'end station id': 400}, 'count': 1}\n",
      "{'_id': {'bikeid': 16909, 'end station id': 520}, 'count': 1}\n",
      "{'_id': {'bikeid': 18126, 'end station id': 3137}, 'count': 1}\n",
      "{'_id': {'bikeid': 16973, 'end station id': 479}, 'count': 1}\n",
      "{'_id': {'bikeid': 15602, 'end station id': 358}, 'count': 1}\n",
      "{'_id': {'bikeid': 21028, 'end station id': 459}, 'count': 1}\n",
      "{'_id': {'bikeid': 18285, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 22965, 'end station id': 3134}, 'count': 1}\n",
      "{'_id': {'bikeid': 17462, 'end station id': 334}, 'count': 1}\n",
      "{'_id': {'bikeid': 15313, 'end station id': 500}, 'count': 1}\n",
      "{'_id': {'bikeid': 24119, 'end station id': 152}, 'count': 1}\n",
      "{'_id': {'bikeid': 22326, 'end station id': 3145}, 'count': 1}\n",
      "{'_id': {'bikeid': 24032, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 22263, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 23503, 'end station id': 2004}, 'count': 1}\n",
      "{'_id': {'bikeid': 22133, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 19720, 'end station id': 507}, 'count': 1}\n",
      "{'_id': {'bikeid': 22235, 'end station id': 372}, 'count': 1}\n",
      "{'_id': {'bikeid': 18485, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 22483, 'end station id': 357}, 'count': 1}\n",
      "{'_id': {'bikeid': 22651, 'end station id': 530}, 'count': 1}\n",
      "{'_id': {'bikeid': 22311, 'end station id': 496}, 'count': 1}\n",
      "{'_id': {'bikeid': 16596, 'end station id': 530}, 'count': 1}\n",
      "{'_id': {'bikeid': 24222, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 22635, 'end station id': 462}, 'count': 1}\n",
      "{'_id': {'bikeid': 19507, 'end station id': 137}, 'count': 1}\n",
      "{'_id': {'bikeid': 20564, 'end station id': 3090}, 'count': 1}\n",
      "{'_id': {'bikeid': 14652, 'end station id': 296}, 'count': 1}\n",
      "{'_id': {'bikeid': 15684, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 23547, 'end station id': 356}, 'count': 1}\n",
      "{'_id': {'bikeid': 23071, 'end station id': 382}, 'count': 1}\n",
      "{'_id': {'bikeid': 18946, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 20280, 'end station id': 3073}, 'count': 1}\n",
      "{'_id': {'bikeid': 17386, 'end station id': 341}, 'count': 1}\n",
      "{'_id': {'bikeid': 22635, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 18223, 'end station id': 3124}, 'count': 1}\n",
      "{'_id': {'bikeid': 20962, 'end station id': 530}, 'count': 1}\n",
      "{'_id': {'bikeid': 23252, 'end station id': 482}, 'count': 1}\n",
      "{'_id': {'bikeid': 23107, 'end station id': 317}, 'count': 1}\n",
      "{'_id': {'bikeid': 16554, 'end station id': 249}, 'count': 1}\n",
      "{'_id': {'bikeid': 22957, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 20098, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 14979, 'end station id': 326}, 'count': 1}\n",
      "{'_id': {'bikeid': 16529, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 18800, 'end station id': 174}, 'count': 1}\n",
      "{'_id': {'bikeid': 20198, 'end station id': 3137}, 'count': 1}\n",
      "{'_id': {'bikeid': 19507, 'end station id': 478}, 'count': 1}\n",
      "{'_id': {'bikeid': 20799, 'end station id': 405}, 'count': 1}\n",
      "{'_id': {'bikeid': 18892, 'end station id': 82}, 'count': 1}\n",
      "{'_id': {'bikeid': 23746, 'end station id': 500}, 'count': 1}\n",
      "{'_id': {'bikeid': 20201, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 15322, 'end station id': 352}, 'count': 1}\n",
      "{'_id': {'bikeid': 19812, 'end station id': 3129}, 'count': 1}\n",
      "{'_id': {'bikeid': 23271, 'end station id': 296}, 'count': 1}\n",
      "{'_id': {'bikeid': 17041, 'end station id': 308}, 'count': 1}\n",
      "{'_id': {'bikeid': 14792, 'end station id': 393}, 'count': 1}\n",
      "{'_id': {'bikeid': 18146, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 21207, 'end station id': 394}, 'count': 1}\n",
      "{'_id': {'bikeid': 22637, 'end station id': 521}, 'count': 1}\n",
      "{'_id': {'bikeid': 20541, 'end station id': 417}, 'count': 1}\n",
      "{'_id': {'bikeid': 24765, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 20846, 'end station id': 3104}, 'count': 1}\n",
      "{'_id': {'bikeid': 19539, 'end station id': 459}, 'count': 1}\n",
      "{'_id': {'bikeid': 19570, 'end station id': 3165}, 'count': 1}\n",
      "{'_id': {'bikeid': 15658, 'end station id': 384}, 'count': 1}\n",
      "{'_id': {'bikeid': 23479, 'end station id': 511}, 'count': 1}\n",
      "{'_id': {'bikeid': 20168, 'end station id': 355}, 'count': 1}\n",
      "{'_id': {'bikeid': 14909, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 19254, 'end station id': 2010}, 'count': 1}\n",
      "{'_id': {'bikeid': 18828, 'end station id': 263}, 'count': 1}\n",
      "{'_id': {'bikeid': 23811, 'end station id': 455}, 'count': 1}\n",
      "{'_id': {'bikeid': 16228, 'end station id': 445}, 'count': 1}\n",
      "{'_id': {'bikeid': 22544, 'end station id': 3124}, 'count': 1}\n",
      "{'_id': {'bikeid': 24009, 'end station id': 328}, 'count': 1}\n",
      "{'_id': {'bikeid': 23613, 'end station id': 503}, 'count': 1}\n",
      "{'_id': {'bikeid': 24003, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 22632, 'end station id': 466}, 'count': 1}\n",
      "{'_id': {'bikeid': 19050, 'end station id': 509}, 'count': 1}\n",
      "{'_id': {'bikeid': 22646, 'end station id': 250}, 'count': 1}\n",
      "{'_id': {'bikeid': 20632, 'end station id': 266}, 'count': 1}\n",
      "{'_id': {'bikeid': 22565, 'end station id': 348}, 'count': 1}\n",
      "{'_id': {'bikeid': 23791, 'end station id': 450}, 'count': 1}\n",
      "{'_id': {'bikeid': 17131, 'end station id': 494}, 'count': 1}\n",
      "{'_id': {'bikeid': 23637, 'end station id': 268}, 'count': 1}\n",
      "{'_id': {'bikeid': 19892, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 22479, 'end station id': 336}, 'count': 1}\n",
      "{'_id': {'bikeid': 17477, 'end station id': 434}, 'count': 1}\n",
      "{'_id': {'bikeid': 23065, 'end station id': 350}, 'count': 1}\n",
      "{'_id': {'bikeid': 16780, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 20230, 'end station id': 3156}, 'count': 1}\n",
      "{'_id': {'bikeid': 15638, 'end station id': 540}, 'count': 1}\n",
      "{'_id': {'bikeid': 16322, 'end station id': 2010}, 'count': 1}\n",
      "{'_id': {'bikeid': 23614, 'end station id': 419}, 'count': 1}\n",
      "{'_id': {'bikeid': 24071, 'end station id': 385}, 'count': 1}\n",
      "{'_id': {'bikeid': 16765, 'end station id': 345}, 'count': 1}\n",
      "{'_id': {'bikeid': 23154, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 20693, 'end station id': 3224}, 'count': 1}\n",
      "{'_id': {'bikeid': 15244, 'end station id': 463}, 'count': 1}\n",
      "{'_id': {'bikeid': 21390, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 23479, 'end station id': 295}, 'count': 1}\n",
      "{'_id': {'bikeid': 23532, 'end station id': 462}, 'count': 1}\n",
      "{'_id': {'bikeid': 19217, 'end station id': 3103}, 'count': 1}\n",
      "{'_id': {'bikeid': 22501, 'end station id': 127}, 'count': 1}\n",
      "{'_id': {'bikeid': 23261, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 22419, 'end station id': 501}, 'count': 1}\n",
      "{'_id': {'bikeid': 17772, 'end station id': 532}, 'count': 1}\n",
      "{'_id': {'bikeid': 19495, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 20792, 'end station id': 528}, 'count': 1}\n",
      "{'_id': {'bikeid': 18708, 'end station id': 3172}, 'count': 1}\n",
      "{'_id': {'bikeid': 22794, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 23554, 'end station id': 455}, 'count': 1}\n",
      "{'_id': {'bikeid': 16867, 'end station id': 347}, 'count': 1}\n",
      "{'_id': {'bikeid': 14980, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 22082, 'end station id': 263}, 'count': 1}\n",
      "{'_id': {'bikeid': 18079, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 23412, 'end station id': 507}, 'count': 1}\n",
      "{'_id': {'bikeid': 15376, 'end station id': 282}, 'count': 1}\n",
      "{'_id': {'bikeid': 24192, 'end station id': 450}, 'count': 1}\n",
      "{'_id': {'bikeid': 19470, 'end station id': 297}, 'count': 1}\n",
      "{'_id': {'bikeid': 21999, 'end station id': 2004}, 'count': 1}\n",
      "{'_id': {'bikeid': 22764, 'end station id': 3042}, 'count': 1}\n",
      "{'_id': {'bikeid': 21399, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 15701, 'end station id': 160}, 'count': 1}\n",
      "{'_id': {'bikeid': 16864, 'end station id': 356}, 'count': 1}\n",
      "{'_id': {'bikeid': 22635, 'end station id': 465}, 'count': 1}\n",
      "{'_id': {'bikeid': 19602, 'end station id': 326}, 'count': 1}\n",
      "{'_id': {'bikeid': 14591, 'end station id': 417}, 'count': 1}\n",
      "{'_id': {'bikeid': 22351, 'end station id': 309}, 'count': 1}\n",
      "{'_id': {'bikeid': 19003, 'end station id': 3160}, 'count': 1}\n",
      "{'_id': {'bikeid': 18889, 'end station id': 461}, 'count': 1}\n",
      "{'_id': {'bikeid': 23874, 'end station id': 438}, 'count': 1}\n",
      "{'_id': {'bikeid': 17282, 'end station id': 513}, 'count': 1}\n",
      "{'_id': {'bikeid': 22040, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 20277, 'end station id': 3177}, 'count': 1}\n",
      "{'_id': {'bikeid': 24265, 'end station id': 487}, 'count': 1}\n",
      "{'_id': {'bikeid': 23246, 'end station id': 491}, 'count': 1}\n",
      "{'_id': {'bikeid': 21683, 'end station id': 405}, 'count': 1}\n",
      "{'_id': {'bikeid': 21496, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 21320, 'end station id': 433}, 'count': 1}\n",
      "{'_id': {'bikeid': 16086, 'end station id': 254}, 'count': 1}\n",
      "{'_id': {'bikeid': 22934, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 19173, 'end station id': 505}, 'count': 1}\n",
      "{'_id': {'bikeid': 20197, 'end station id': 488}, 'count': 1}\n",
      "{'_id': {'bikeid': 23795, 'end station id': 280}, 'count': 1}\n",
      "{'_id': {'bikeid': 23389, 'end station id': 522}, 'count': 1}\n",
      "{'_id': {'bikeid': 23176, 'end station id': 368}, 'count': 1}\n",
      "{'_id': {'bikeid': 15691, 'end station id': 486}, 'count': 1}\n",
      "{'_id': {'bikeid': 22814, 'end station id': 3055}, 'count': 1}\n",
      "{'_id': {'bikeid': 23323, 'end station id': 469}, 'count': 1}\n",
      "{'_id': {'bikeid': 15681, 'end station id': 355}, 'count': 1}\n",
      "{'_id': {'bikeid': 23592, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 17610, 'end station id': 379}, 'count': 1}\n",
      "{'_id': {'bikeid': 15541, 'end station id': 233}, 'count': 1}\n",
      "{'_id': {'bikeid': 22949, 'end station id': 526}, 'count': 1}\n",
      "{'_id': {'bikeid': 19094, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 17131, 'end station id': 3170}, 'count': 1}\n",
      "{'_id': {'bikeid': 20062, 'end station id': 2021}, 'count': 1}\n",
      "{'_id': {'bikeid': 22112, 'end station id': 352}, 'count': 1}\n",
      "{'_id': {'bikeid': 14967, 'end station id': 268}, 'count': 1}\n",
      "{'_id': {'bikeid': 20850, 'end station id': 281}, 'count': 1}\n",
      "{'_id': {'bikeid': 20198, 'end station id': 281}, 'count': 1}\n",
      "{'_id': {'bikeid': 23167, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 16734, 'end station id': 316}, 'count': 1}\n",
      "{'_id': {'bikeid': 17308, 'end station id': 300}, 'count': 1}\n",
      "{'_id': {'bikeid': 21042, 'end station id': 296}, 'count': 1}\n",
      "{'_id': {'bikeid': 21163, 'end station id': 505}, 'count': 1}\n",
      "{'_id': {'bikeid': 15683, 'end station id': 3158}, 'count': 1}\n",
      "{'_id': {'bikeid': 15709, 'end station id': 487}, 'count': 1}\n",
      "{'_id': {'bikeid': 23968, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 22704, 'end station id': 446}, 'count': 1}\n",
      "{'_id': {'bikeid': 15259, 'end station id': 146}, 'count': 1}\n",
      "{'_id': {'bikeid': 15065, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 19275, 'end station id': 3124}, 'count': 1}\n",
      "{'_id': {'bikeid': 24152, 'end station id': 445}, 'count': 1}\n",
      "{'_id': {'bikeid': 23140, 'end station id': 358}, 'count': 1}\n",
      "{'_id': {'bikeid': 24183, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 21656, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 20345, 'end station id': 507}, 'count': 1}\n",
      "{'_id': {'bikeid': 22220, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 20693, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 16296, 'end station id': 330}, 'count': 1}\n",
      "{'_id': {'bikeid': 22487, 'end station id': 334}, 'count': 1}\n",
      "{'_id': {'bikeid': 23999, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 23516, 'end station id': 375}, 'count': 1}\n",
      "{'_id': {'bikeid': 19921, 'end station id': 474}, 'count': 1}\n",
      "{'_id': {'bikeid': 23179, 'end station id': 415}, 'count': 1}\n",
      "{'_id': {'bikeid': 23809, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 16917, 'end station id': 285}, 'count': 1}\n",
      "{'_id': {'bikeid': 24288, 'end station id': 236}, 'count': 1}\n",
      "{'_id': {'bikeid': 22680, 'end station id': 531}, 'count': 1}\n",
      "{'_id': {'bikeid': 24313, 'end station id': 410}, 'count': 1}\n",
      "{'_id': {'bikeid': 14732, 'end station id': 361}, 'count': 1}\n",
      "{'_id': {'bikeid': 16301, 'end station id': 3167}, 'count': 1}\n",
      "{'_id': {'bikeid': 16765, 'end station id': 405}, 'count': 1}\n",
      "{'_id': {'bikeid': 19804, 'end station id': 512}, 'count': 1}\n",
      "{'_id': {'bikeid': 21648, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 16180, 'end station id': 428}, 'count': 1}\n",
      "{'_id': {'bikeid': 22782, 'end station id': 3084}, 'count': 1}\n",
      "{'_id': {'bikeid': 24234, 'end station id': 310}, 'count': 1}\n",
      "{'_id': {'bikeid': 22285, 'end station id': 306}, 'count': 1}\n",
      "{'_id': {'bikeid': 20837, 'end station id': 348}, 'count': 1}\n",
      "{'_id': {'bikeid': 19810, 'end station id': 3136}, 'count': 1}\n",
      "{'_id': {'bikeid': 22823, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 18860, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 19671, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 19804, 'end station id': 479}, 'count': 1}\n",
      "{'_id': {'bikeid': 15951, 'end station id': 326}, 'count': 1}\n",
      "{'_id': {'bikeid': 22642, 'end station id': 311}, 'count': 1}\n",
      "{'_id': {'bikeid': 14789, 'end station id': 146}, 'count': 1}\n",
      "{'_id': {'bikeid': 19837, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 14926, 'end station id': 324}, 'count': 1}\n",
      "{'_id': {'bikeid': 22677, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 23803, 'end station id': 500}, 'count': 1}\n",
      "{'_id': {'bikeid': 16543, 'end station id': 520}, 'count': 1}\n",
      "{'_id': {'bikeid': 15081, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 17633, 'end station id': 336}, 'count': 1}\n",
      "{'_id': {'bikeid': 19557, 'end station id': 3161}, 'count': 1}\n",
      "{'_id': {'bikeid': 21218, 'end station id': 173}, 'count': 1}\n",
      "{'_id': {'bikeid': 15385, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 15691, 'end station id': 3136}, 'count': 1}\n",
      "{'_id': {'bikeid': 21228, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 17827, 'end station id': 498}, 'count': 1}\n",
      "{'_id': {'bikeid': 22948, 'end station id': 462}, 'count': 1}\n",
      "{'_id': {'bikeid': 22762, 'end station id': 3093}, 'count': 1}\n",
      "{'_id': {'bikeid': 18878, 'end station id': 459}, 'count': 1}\n",
      "{'_id': {'bikeid': 16917, 'end station id': 428}, 'count': 1}\n",
      "{'_id': {'bikeid': 21444, 'end station id': 3119}, 'count': 1}\n",
      "{'_id': {'bikeid': 18592, 'end station id': 300}, 'count': 1}\n",
      "{'_id': {'bikeid': 22171, 'end station id': 3147}, 'count': 1}\n",
      "{'_id': {'bikeid': 22506, 'end station id': 520}, 'count': 1}\n",
      "{'_id': {'bikeid': 22989, 'end station id': 475}, 'count': 1}\n",
      "{'_id': {'bikeid': 23938, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 15910, 'end station id': 397}, 'count': 1}\n",
      "{'_id': {'bikeid': 15599, 'end station id': 157}, 'count': 1}\n",
      "{'_id': {'bikeid': 22165, 'end station id': 528}, 'count': 1}\n",
      "{'_id': {'bikeid': 15235, 'end station id': 3235}, 'count': 1}\n",
      "{'_id': {'bikeid': 14620, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 21997, 'end station id': 284}, 'count': 1}\n",
      "{'_id': {'bikeid': 22285, 'end station id': 263}, 'count': 1}\n",
      "{'_id': {'bikeid': 21985, 'end station id': 523}, 'count': 1}\n",
      "{'_id': {'bikeid': 24199, 'end station id': 500}, 'count': 1}\n",
      "{'_id': {'bikeid': 23619, 'end station id': 250}, 'count': 1}\n",
      "{'_id': {'bikeid': 22651, 'end station id': 475}, 'count': 1}\n",
      "{'_id': {'bikeid': 14551, 'end station id': 224}, 'count': 1}\n",
      "{'_id': {'bikeid': 22940, 'end station id': 300}, 'count': 1}\n",
      "{'_id': {'bikeid': 14665, 'end station id': 345}, 'count': 1}\n",
      "{'_id': {'bikeid': 22820, 'end station id': 268}, 'count': 1}\n",
      "{'_id': {'bikeid': 22820, 'end station id': 516}, 'count': 1}\n",
      "{'_id': {'bikeid': 24189, 'end station id': 167}, 'count': 1}\n",
      "{'_id': {'bikeid': 19381, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 23985, 'end station id': 229}, 'count': 1}\n",
      "{'_id': {'bikeid': 23448, 'end station id': 496}, 'count': 1}\n",
      "{'_id': {'bikeid': 15148, 'end station id': 3162}, 'count': 1}\n",
      "{'_id': {'bikeid': 22060, 'end station id': 2023}, 'count': 1}\n",
      "{'_id': {'bikeid': 20163, 'end station id': 355}, 'count': 1}\n",
      "{'_id': {'bikeid': 18850, 'end station id': 509}, 'count': 1}\n",
      "{'_id': {'bikeid': 18149, 'end station id': 2021}, 'count': 1}\n",
      "{'_id': {'bikeid': 16805, 'end station id': 173}, 'count': 1}\n",
      "{'_id': {'bikeid': 23094, 'end station id': 355}, 'count': 1}\n",
      "{'_id': {'bikeid': 21551, 'end station id': 467}, 'count': 1}\n",
      "{'_id': {'bikeid': 20535, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 24276, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 18060, 'end station id': 3103}, 'count': 1}\n",
      "{'_id': {'bikeid': 18216, 'end station id': 358}, 'count': 1}\n",
      "{'_id': {'bikeid': 23222, 'end station id': 411}, 'count': 1}\n",
      "{'_id': {'bikeid': 23497, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 23523, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 20998, 'end station id': 212}, 'count': 1}\n",
      "{'_id': {'bikeid': 22285, 'end station id': 327}, 'count': 1}\n",
      "{'_id': {'bikeid': 23116, 'end station id': 303}, 'count': 1}\n",
      "{'_id': {'bikeid': 22795, 'end station id': 253}, 'count': 1}\n",
      "{'_id': {'bikeid': 24328, 'end station id': 334}, 'count': 1}\n",
      "{'_id': {'bikeid': 19283, 'end station id': 474}, 'count': 1}\n",
      "{'_id': {'bikeid': 17682, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 23891, 'end station id': 3104}, 'count': 1}\n",
      "{'_id': {'bikeid': 19093, 'end station id': 301}, 'count': 1}\n",
      "{'_id': {'bikeid': 24284, 'end station id': 537}, 'count': 1}\n",
      "{'_id': {'bikeid': 22514, 'end station id': 523}, 'count': 1}\n",
      "{'_id': {'bikeid': 17970, 'end station id': 498}, 'count': 1}\n",
      "{'_id': {'bikeid': 21648, 'end station id': 472}, 'count': 1}\n",
      "{'_id': {'bikeid': 22487, 'end station id': 458}, 'count': 1}\n",
      "{'_id': {'bikeid': 21707, 'end station id': 405}, 'count': 1}\n",
      "{'_id': {'bikeid': 23273, 'end station id': 463}, 'count': 1}\n",
      "{'_id': {'bikeid': 22116, 'end station id': 380}, 'count': 1}\n",
      "{'_id': {'bikeid': 23644, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 19445, 'end station id': 157}, 'count': 1}\n",
      "{'_id': {'bikeid': 22973, 'end station id': 236}, 'count': 1}\n",
      "{'_id': {'bikeid': 24071, 'end station id': 490}, 'count': 1}\n",
      "{'_id': {'bikeid': 15587, 'end station id': 3169}, 'count': 1}\n",
      "{'_id': {'bikeid': 22653, 'end station id': 540}, 'count': 1}\n",
      "{'_id': {'bikeid': 23547, 'end station id': 297}, 'count': 1}\n",
      "{'_id': {'bikeid': 14863, 'end station id': 403}, 'count': 1}\n",
      "{'_id': {'bikeid': 15223, 'end station id': 3103}, 'count': 1}\n",
      "{'_id': {'bikeid': 20038, 'end station id': 301}, 'count': 1}\n",
      "{'_id': {'bikeid': 14817, 'end station id': 405}, 'count': 1}\n",
      "{'_id': {'bikeid': 22091, 'end station id': 301}, 'count': 1}\n",
      "{'_id': {'bikeid': 15998, 'end station id': 312}, 'count': 1}\n",
      "{'_id': {'bikeid': 22848, 'end station id': 398}, 'count': 1}\n",
      "{'_id': {'bikeid': 23106, 'end station id': 482}, 'count': 1}\n",
      "{'_id': {'bikeid': 16219, 'end station id': 249}, 'count': 1}\n",
      "{'_id': {'bikeid': 16900, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 23760, 'end station id': 545}, 'count': 1}\n",
      "{'_id': {'bikeid': 23285, 'end station id': 470}, 'count': 1}\n",
      "{'_id': {'bikeid': 23791, 'end station id': 495}, 'count': 1}\n",
      "{'_id': {'bikeid': 22956, 'end station id': 433}, 'count': 1}\n",
      "{'_id': {'bikeid': 23753, 'end station id': 401}, 'count': 1}\n",
      "{'_id': {'bikeid': 18598, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 23671, 'end station id': 3156}, 'count': 1}\n",
      "{'_id': {'bikeid': 21416, 'end station id': 285}, 'count': 1}\n",
      "{'_id': {'bikeid': 24065, 'end station id': 3163}, 'count': 1}\n",
      "{'_id': {'bikeid': 22483, 'end station id': 408}, 'count': 1}\n",
      "{'_id': {'bikeid': 17078, 'end station id': 495}, 'count': 1}\n",
      "{'_id': {'bikeid': 22785, 'end station id': 377}, 'count': 1}\n",
      "{'_id': {'bikeid': 22902, 'end station id': 536}, 'count': 1}\n",
      "{'_id': {'bikeid': 15680, 'end station id': 462}, 'count': 1}\n",
      "{'_id': {'bikeid': 15537, 'end station id': 3145}, 'count': 1}\n",
      "{'_id': {'bikeid': 18665, 'end station id': 490}, 'count': 1}\n",
      "{'_id': {'bikeid': 15664, 'end station id': 539}, 'count': 1}\n",
      "{'_id': {'bikeid': 18504, 'end station id': 326}, 'count': 1}\n",
      "{'_id': {'bikeid': 21198, 'end station id': 375}, 'count': 1}\n",
      "{'_id': {'bikeid': 22823, 'end station id': 326}, 'count': 1}\n",
      "{'_id': {'bikeid': 23619, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 22709, 'end station id': 303}, 'count': 1}\n",
      "{'_id': {'bikeid': 22423, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 24221, 'end station id': 3125}, 'count': 1}\n",
      "{'_id': {'bikeid': 21624, 'end station id': 2003}, 'count': 1}\n",
      "{'_id': {'bikeid': 22874, 'end station id': 305}, 'count': 1}\n",
      "{'_id': {'bikeid': 18414, 'end station id': 279}, 'count': 1}\n",
      "{'_id': {'bikeid': 23694, 'end station id': 388}, 'count': 1}\n",
      "{'_id': {'bikeid': 18426, 'end station id': 346}, 'count': 1}\n",
      "{'_id': {'bikeid': 24328, 'end station id': 336}, 'count': 1}\n",
      "{'_id': {'bikeid': 20935, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 14733, 'end station id': 3165}, 'count': 1}\n",
      "{'_id': {'bikeid': 22517, 'end station id': 446}, 'count': 1}\n",
      "{'_id': {'bikeid': 23744, 'end station id': 438}, 'count': 1}\n",
      "{'_id': {'bikeid': 23636, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 22989, 'end station id': 3134}, 'count': 1}\n",
      "{'_id': {'bikeid': 22545, 'end station id': 252}, 'count': 1}\n",
      "{'_id': {'bikeid': 17152, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 16216, 'end station id': 174}, 'count': 1}\n",
      "{'_id': {'bikeid': 22761, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 20851, 'end station id': 456}, 'count': 1}\n",
      "{'_id': {'bikeid': 17535, 'end station id': 479}, 'count': 1}\n",
      "{'_id': {'bikeid': 23514, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 18834, 'end station id': 450}, 'count': 1}\n",
      "{'_id': {'bikeid': 20913, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 14655, 'end station id': 328}, 'count': 1}\n",
      "{'_id': {'bikeid': 23411, 'end station id': 380}, 'count': 1}\n",
      "{'_id': {'bikeid': 17030, 'end station id': 511}, 'count': 1}\n",
      "{'_id': {'bikeid': 22725, 'end station id': 3090}, 'count': 1}\n",
      "{'_id': {'bikeid': 22492, 'end station id': 513}, 'count': 1}\n",
      "{'_id': {'bikeid': 23987, 'end station id': 361}, 'count': 1}\n",
      "{'_id': {'bikeid': 24183, 'end station id': 3164}, 'count': 1}\n",
      "{'_id': {'bikeid': 23824, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 22646, 'end station id': 454}, 'count': 1}\n",
      "{'_id': {'bikeid': 21278, 'end station id': 368}, 'count': 1}\n",
      "{'_id': {'bikeid': 21993, 'end station id': 479}, 'count': 1}\n",
      "{'_id': {'bikeid': 15093, 'end station id': 3067}, 'count': 1}\n",
      "{'_id': {'bikeid': 21303, 'end station id': 3224}, 'count': 1}\n",
      "{'_id': {'bikeid': 21688, 'end station id': 301}, 'count': 1}\n",
      "{'_id': {'bikeid': 19903, 'end station id': 3092}, 'count': 1}\n",
      "{'_id': {'bikeid': 15875, 'end station id': 3112}, 'count': 1}\n",
      "{'_id': {'bikeid': 22444, 'end station id': 456}, 'count': 1}\n",
      "{'_id': {'bikeid': 24183, 'end station id': 509}, 'count': 1}\n",
      "{'_id': {'bikeid': 19945, 'end station id': 465}, 'count': 1}\n",
      "{'_id': {'bikeid': 23516, 'end station id': 128}, 'count': 1}\n",
      "{'_id': {'bikeid': 22067, 'end station id': 3156}, 'count': 1}\n",
      "{'_id': {'bikeid': 18619, 'end station id': 502}, 'count': 1}\n",
      "{'_id': {'bikeid': 14918, 'end station id': 365}, 'count': 1}\n",
      "{'_id': {'bikeid': 14529, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 16152, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 15131, 'end station id': 526}, 'count': 1}\n",
      "{'_id': {'bikeid': 14570, 'end station id': 391}, 'count': 1}\n",
      "{'_id': {'bikeid': 18616, 'end station id': 305}, 'count': 1}\n",
      "{'_id': {'bikeid': 23207, 'end station id': 3178}, 'count': 1}\n",
      "{'_id': {'bikeid': 21673, 'end station id': 457}, 'count': 1}\n",
      "{'_id': {'bikeid': 20768, 'end station id': 428}, 'count': 1}\n",
      "{'_id': {'bikeid': 22916, 'end station id': 212}, 'count': 1}\n",
      "{'_id': {'bikeid': 18649, 'end station id': 375}, 'count': 1}\n",
      "{'_id': {'bikeid': 19557, 'end station id': 3173}, 'count': 1}\n",
      "{'_id': {'bikeid': 21615, 'end station id': 306}, 'count': 1}\n",
      "{'_id': {'bikeid': 17653, 'end station id': 458}, 'count': 1}\n",
      "{'_id': {'bikeid': 19176, 'end station id': 3143}, 'count': 1}\n",
      "{'_id': {'bikeid': 20220, 'end station id': 403}, 'count': 1}\n",
      "{'_id': {'bikeid': 18849, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 20715, 'end station id': 314}, 'count': 1}\n",
      "{'_id': {'bikeid': 22253, 'end station id': 524}, 'count': 1}\n",
      "{'_id': {'bikeid': 18968, 'end station id': 3180}, 'count': 1}\n",
      "{'_id': {'bikeid': 23178, 'end station id': 3165}, 'count': 1}\n",
      "{'_id': {'bikeid': 22530, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 19389, 'end station id': 472}, 'count': 1}\n",
      "{'_id': {'bikeid': 24199, 'end station id': 228}, 'count': 1}\n",
      "{'_id': {'bikeid': 15708, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 22326, 'end station id': 3169}, 'count': 1}\n",
      "{'_id': {'bikeid': 18539, 'end station id': 350}, 'count': 1}\n",
      "{'_id': {'bikeid': 16811, 'end station id': 516}, 'count': 1}\n",
      "{'_id': {'bikeid': 23180, 'end station id': 473}, 'count': 1}\n",
      "{'_id': {'bikeid': 23934, 'end station id': 520}, 'count': 1}\n",
      "{'_id': {'bikeid': 23809, 'end station id': 525}, 'count': 1}\n",
      "{'_id': {'bikeid': 22642, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 24199, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 20098, 'end station id': 253}, 'count': 1}\n",
      "{'_id': {'bikeid': 22198, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 23246, 'end station id': 236}, 'count': 1}\n",
      "{'_id': {'bikeid': 15877, 'end station id': 3137}, 'count': 1}\n",
      "{'_id': {'bikeid': 23411, 'end station id': 3101}, 'count': 1}\n",
      "{'_id': {'bikeid': 24281, 'end station id': 394}, 'count': 1}\n",
      "{'_id': {'bikeid': 22307, 'end station id': 473}, 'count': 1}\n",
      "{'_id': {'bikeid': 19236, 'end station id': 380}, 'count': 1}\n",
      "{'_id': {'bikeid': 17817, 'end station id': 402}, 'count': 1}\n",
      "{'_id': {'bikeid': 15158, 'end station id': 310}, 'count': 1}\n",
      "{'_id': {'bikeid': 17041, 'end station id': 465}, 'count': 1}\n",
      "{'_id': {'bikeid': 17896, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 16374, 'end station id': 116}, 'count': 1}\n",
      "{'_id': {'bikeid': 24032, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 15014, 'end station id': 3054}, 'count': 1}\n",
      "{'_id': {'bikeid': 17639, 'end station id': 251}, 'count': 1}\n",
      "{'_id': {'bikeid': 23399, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 23502, 'end station id': 3165}, 'count': 1}\n",
      "{'_id': {'bikeid': 19492, 'end station id': 3178}, 'count': 1}\n",
      "{'_id': {'bikeid': 22146, 'end station id': 340}, 'count': 1}\n",
      "{'_id': {'bikeid': 23534, 'end station id': 466}, 'count': 1}\n",
      "{'_id': {'bikeid': 21769, 'end station id': 3143}, 'count': 1}\n",
      "{'_id': {'bikeid': 21223, 'end station id': 369}, 'count': 1}\n",
      "{'_id': {'bikeid': 23503, 'end station id': 257}, 'count': 1}\n",
      "{'_id': {'bikeid': 20190, 'end station id': 3068}, 'count': 1}\n",
      "{'_id': {'bikeid': 21282, 'end station id': 279}, 'count': 1}\n",
      "{'_id': {'bikeid': 14792, 'end station id': 254}, 'count': 1}\n",
      "{'_id': {'bikeid': 22174, 'end station id': 3165}, 'count': 1}\n",
      "{'_id': {'bikeid': 17272, 'end station id': 3148}, 'count': 1}\n",
      "{'_id': {'bikeid': 18781, 'end station id': 450}, 'count': 1}\n",
      "{'_id': {'bikeid': 24280, 'end station id': 3124}, 'count': 1}\n",
      "{'_id': {'bikeid': 21924, 'end station id': 486}, 'count': 1}\n",
      "{'_id': {'bikeid': 23273, 'end station id': 450}, 'count': 1}\n",
      "{'_id': {'bikeid': 21117, 'end station id': 410}, 'count': 1}\n",
      "{'_id': {'bikeid': 19886, 'end station id': 379}, 'count': 1}\n",
      "{'_id': {'bikeid': 23095, 'end station id': 382}, 'count': 1}\n",
      "{'_id': {'bikeid': 23922, 'end station id': 509}, 'count': 1}\n",
      "{'_id': {'bikeid': 23592, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 19671, 'end station id': 3166}, 'count': 1}\n",
      "{'_id': {'bikeid': 23554, 'end station id': 265}, 'count': 1}\n",
      "{'_id': {'bikeid': 20355, 'end station id': 150}, 'count': 1}\n",
      "{'_id': {'bikeid': 15277, 'end station id': 367}, 'count': 1}\n",
      "{'_id': {'bikeid': 21985, 'end station id': 546}, 'count': 1}\n",
      "{'_id': {'bikeid': 17547, 'end station id': 3163}, 'count': 1}\n",
      "{'_id': {'bikeid': 21720, 'end station id': 512}, 'count': 1}\n",
      "{'_id': {'bikeid': 17572, 'end station id': 519}, 'count': 1}\n",
      "{'_id': {'bikeid': 17369, 'end station id': 3155}, 'count': 1}\n",
      "{'_id': {'bikeid': 23398, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 21673, 'end station id': 3177}, 'count': 1}\n",
      "{'_id': {'bikeid': 22103, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 22093, 'end station id': 459}, 'count': 1}\n",
      "{'_id': {'bikeid': 23010, 'end station id': 510}, 'count': 1}\n",
      "{'_id': {'bikeid': 22127, 'end station id': 319}, 'count': 1}\n",
      "{'_id': {'bikeid': 21995, 'end station id': 487}, 'count': 1}\n",
      "{'_id': {'bikeid': 22661, 'end station id': 511}, 'count': 1}\n",
      "{'_id': {'bikeid': 23923, 'end station id': 284}, 'count': 1}\n",
      "{'_id': {'bikeid': 24100, 'end station id': 490}, 'count': 1}\n",
      "{'_id': {'bikeid': 15721, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 17177, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 22253, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 20792, 'end station id': 2012}, 'count': 1}\n",
      "{'_id': {'bikeid': 21081, 'end station id': 367}, 'count': 1}\n",
      "{'_id': {'bikeid': 22401, 'end station id': 3143}, 'count': 1}\n",
      "{'_id': {'bikeid': 22475, 'end station id': 368}, 'count': 1}\n",
      "{'_id': {'bikeid': 18112, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 17656, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 24258, 'end station id': 161}, 'count': 1}\n",
      "{'_id': {'bikeid': 21876, 'end station id': 3147}, 'count': 1}\n",
      "{'_id': {'bikeid': 17984, 'end station id': 173}, 'count': 1}\n",
      "{'_id': {'bikeid': 20100, 'end station id': 504}, 'count': 1}\n",
      "{'_id': {'bikeid': 22806, 'end station id': 325}, 'count': 1}\n",
      "{'_id': {'bikeid': 20751, 'end station id': 3141}, 'count': 1}\n",
      "{'_id': {'bikeid': 22977, 'end station id': 3115}, 'count': 1}\n",
      "{'_id': {'bikeid': 23704, 'end station id': 285}, 'count': 1}\n",
      "{'_id': {'bikeid': 24006, 'end station id': 3176}, 'count': 1}\n",
      "{'_id': {'bikeid': 21011, 'end station id': 3137}, 'count': 1}\n",
      "{'_id': {'bikeid': 23027, 'end station id': 383}, 'count': 1}\n",
      "{'_id': {'bikeid': 18457, 'end station id': 375}, 'count': 1}\n",
      "{'_id': {'bikeid': 19088, 'end station id': 3090}, 'count': 1}\n",
      "{'_id': {'bikeid': 20078, 'end station id': 442}, 'count': 1}\n",
      "{'_id': {'bikeid': 21567, 'end station id': 116}, 'count': 1}\n",
      "{'_id': {'bikeid': 15090, 'end station id': 445}, 'count': 1}\n",
      "{'_id': {'bikeid': 20330, 'end station id': 195}, 'count': 1}\n",
      "{'_id': {'bikeid': 23714, 'end station id': 331}, 'count': 1}\n",
      "{'_id': {'bikeid': 23267, 'end station id': 421}, 'count': 1}\n",
      "{'_id': {'bikeid': 20049, 'end station id': 3092}, 'count': 1}\n",
      "{'_id': {'bikeid': 23149, 'end station id': 478}, 'count': 1}\n",
      "{'_id': {'bikeid': 22761, 'end station id': 546}, 'count': 1}\n",
      "{'_id': {'bikeid': 19096, 'end station id': 258}, 'count': 1}\n",
      "{'_id': {'bikeid': 21349, 'end station id': 389}, 'count': 1}\n",
      "{'_id': {'bikeid': 18118, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 19608, 'end station id': 520}, 'count': 1}\n",
      "{'_id': {'bikeid': 23175, 'end station id': 540}, 'count': 1}\n",
      "{'_id': {'bikeid': 21165, 'end station id': 504}, 'count': 1}\n",
      "{'_id': {'bikeid': 22956, 'end station id': 475}, 'count': 1}\n",
      "{'_id': {'bikeid': 20767, 'end station id': 545}, 'count': 1}\n",
      "{'_id': {'bikeid': 23760, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 23113, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 14707, 'end station id': 352}, 'count': 1}\n",
      "{'_id': {'bikeid': 16893, 'end station id': 532}, 'count': 1}\n",
      "{'_id': {'bikeid': 16386, 'end station id': 472}, 'count': 1}\n",
      "{'_id': {'bikeid': 22417, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 15949, 'end station id': 257}, 'count': 1}\n",
      "{'_id': {'bikeid': 23847, 'end station id': 161}, 'count': 1}\n",
      "{'_id': {'bikeid': 24317, 'end station id': 308}, 'count': 1}\n",
      "{'_id': {'bikeid': 17299, 'end station id': 351}, 'count': 1}\n",
      "{'_id': {'bikeid': 22230, 'end station id': 511}, 'count': 1}\n",
      "{'_id': {'bikeid': 21966, 'end station id': 250}, 'count': 1}\n",
      "{'_id': {'bikeid': 21606, 'end station id': 2017}, 'count': 1}\n",
      "{'_id': {'bikeid': 20717, 'end station id': 330}, 'count': 1}\n",
      "{'_id': {'bikeid': 20607, 'end station id': 3168}, 'count': 1}\n",
      "{'_id': {'bikeid': 22806, 'end station id': 488}, 'count': 1}\n",
      "{'_id': {'bikeid': 24281, 'end station id': 265}, 'count': 1}\n",
      "{'_id': {'bikeid': 15788, 'end station id': 389}, 'count': 1}\n",
      "{'_id': {'bikeid': 19027, 'end station id': 143}, 'count': 1}\n",
      "{'_id': {'bikeid': 21915, 'end station id': 310}, 'count': 1}\n",
      "{'_id': {'bikeid': 18769, 'end station id': 361}, 'count': 1}\n",
      "{'_id': {'bikeid': 23590, 'end station id': 428}, 'count': 1}\n",
      "{'_id': {'bikeid': 23667, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 23847, 'end station id': 388}, 'count': 1}\n",
      "{'_id': {'bikeid': 24135, 'end station id': 449}, 'count': 1}\n",
      "{'_id': {'bikeid': 16240, 'end station id': 261}, 'count': 1}\n",
      "{'_id': {'bikeid': 16104, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 18057, 'end station id': 518}, 'count': 1}\n",
      "{'_id': {'bikeid': 23638, 'end station id': 308}, 'count': 1}\n",
      "{'_id': {'bikeid': 22176, 'end station id': 356}, 'count': 1}\n",
      "{'_id': {'bikeid': 24062, 'end station id': 309}, 'count': 1}\n",
      "{'_id': {'bikeid': 15877, 'end station id': 3160}, 'count': 1}\n",
      "{'_id': {'bikeid': 23582, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 17282, 'end station id': 465}, 'count': 1}\n",
      "{'_id': {'bikeid': 21317, 'end station id': 127}, 'count': 1}\n",
      "{'_id': {'bikeid': 20163, 'end station id': 259}, 'count': 1}\n",
      "{'_id': {'bikeid': 19892, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 22014, 'end station id': 507}, 'count': 1}\n",
      "{'_id': {'bikeid': 19217, 'end station id': 3112}, 'count': 1}\n",
      "{'_id': {'bikeid': 20247, 'end station id': 454}, 'count': 1}\n",
      "{'_id': {'bikeid': 16605, 'end station id': 3226}, 'count': 1}\n",
      "{'_id': {'bikeid': 20335, 'end station id': 311}, 'count': 1}\n",
      "{'_id': {'bikeid': 14873, 'end station id': 317}, 'count': 1}\n",
      "{'_id': {'bikeid': 19570, 'end station id': 3143}, 'count': 1}\n",
      "{'_id': {'bikeid': 15986, 'end station id': 434}, 'count': 1}\n",
      "{'_id': {'bikeid': 21317, 'end station id': 494}, 'count': 1}\n",
      "{'_id': {'bikeid': 15987, 'end station id': 3147}, 'count': 1}\n",
      "{'_id': {'bikeid': 22900, 'end station id': 250}, 'count': 1}\n",
      "{'_id': {'bikeid': 23890, 'end station id': 512}, 'count': 1}\n",
      "{'_id': {'bikeid': 23968, 'end station id': 383}, 'count': 1}\n",
      "{'_id': {'bikeid': 23803, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 15688, 'end station id': 247}, 'count': 1}\n",
      "{'_id': {'bikeid': 19804, 'end station id': 279}, 'count': 1}\n",
      "{'_id': {'bikeid': 18371, 'end station id': 515}, 'count': 1}\n",
      "{'_id': {'bikeid': 19173, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 18634, 'end station id': 304}, 'count': 1}\n",
      "{'_id': {'bikeid': 18834, 'end station id': 309}, 'count': 1}\n",
      "{'_id': {'bikeid': 23216, 'end station id': 3156}, 'count': 1}\n",
      "{'_id': {'bikeid': 21424, 'end station id': 394}, 'count': 1}\n",
      "{'_id': {'bikeid': 23794, 'end station id': 3135}, 'count': 1}\n",
      "{'_id': {'bikeid': 23136, 'end station id': 212}, 'count': 1}\n",
      "{'_id': {'bikeid': 16107, 'end station id': 3106}, 'count': 1}\n",
      "{'_id': {'bikeid': 23899, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 21993, 'end station id': 456}, 'count': 1}\n",
      "{'_id': {'bikeid': 18356, 'end station id': 457}, 'count': 1}\n",
      "{'_id': {'bikeid': 22212, 'end station id': 3140}, 'count': 1}\n",
      "{'_id': {'bikeid': 22679, 'end station id': 365}, 'count': 1}\n",
      "{'_id': {'bikeid': 18868, 'end station id': 3129}, 'count': 1}\n",
      "{'_id': {'bikeid': 22336, 'end station id': 445}, 'count': 1}\n",
      "{'_id': {'bikeid': 23165, 'end station id': 236}, 'count': 1}\n",
      "{'_id': {'bikeid': 20098, 'end station id': 382}, 'count': 1}\n",
      "{'_id': {'bikeid': 17544, 'end station id': 487}, 'count': 1}\n",
      "{'_id': {'bikeid': 23884, 'end station id': 249}, 'count': 1}\n",
      "{'_id': {'bikeid': 16008, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 19822, 'end station id': 250}, 'count': 1}\n",
      "{'_id': {'bikeid': 22344, 'end station id': 492}, 'count': 1}\n",
      "{'_id': {'bikeid': 20286, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 23324, 'end station id': 3145}, 'count': 1}\n",
      "{'_id': {'bikeid': 24034, 'end station id': 3155}, 'count': 1}\n",
      "{'_id': {'bikeid': 15780, 'end station id': 545}, 'count': 1}\n",
      "{'_id': {'bikeid': 23566, 'end station id': 319}, 'count': 1}\n",
      "{'_id': {'bikeid': 23456, 'end station id': 2021}, 'count': 1}\n",
      "{'_id': {'bikeid': 21467, 'end station id': 3124}, 'count': 1}\n",
      "{'_id': {'bikeid': 17478, 'end station id': 119}, 'count': 1}\n",
      "{'_id': {'bikeid': 20071, 'end station id': 311}, 'count': 1}\n",
      "{'_id': {'bikeid': 23389, 'end station id': 520}, 'count': 1}\n",
      "{'_id': {'bikeid': 21209, 'end station id': 327}, 'count': 1}\n",
      "{'_id': {'bikeid': 23439, 'end station id': 3160}, 'count': 1}\n",
      "{'_id': {'bikeid': 22127, 'end station id': 224}, 'count': 1}\n",
      "{'_id': {'bikeid': 24127, 'end station id': 337}, 'count': 1}\n",
      "{'_id': {'bikeid': 23721, 'end station id': 3171}, 'count': 1}\n",
      "{'_id': {'bikeid': 16017, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 19502, 'end station id': 495}, 'count': 1}\n",
      "{'_id': {'bikeid': 22831, 'end station id': 285}, 'count': 1}\n",
      "{'_id': {'bikeid': 21037, 'end station id': 410}, 'count': 1}\n",
      "{'_id': {'bikeid': 16195, 'end station id': 3224}, 'count': 1}\n",
      "{'_id': {'bikeid': 22417, 'end station id': 267}, 'count': 1}\n",
      "{'_id': {'bikeid': 23209, 'end station id': 454}, 'count': 1}\n",
      "{'_id': {'bikeid': 22632, 'end station id': 468}, 'count': 1}\n",
      "{'_id': {'bikeid': 18216, 'end station id': 3166}, 'count': 1}\n",
      "{'_id': {'bikeid': 14707, 'end station id': 3145}, 'count': 1}\n",
      "{'_id': {'bikeid': 15258, 'end station id': 498}, 'count': 1}\n",
      "{'_id': {'bikeid': 22560, 'end station id': 3166}, 'count': 1}\n",
      "{'_id': {'bikeid': 24547, 'end station id': 380}, 'count': 1}\n",
      "{'_id': {'bikeid': 21223, 'end station id': 358}, 'count': 1}\n",
      "{'_id': {'bikeid': 20809, 'end station id': 511}, 'count': 1}\n",
      "{'_id': {'bikeid': 18878, 'end station id': 533}, 'count': 1}\n",
      "{'_id': {'bikeid': 19125, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 15433, 'end station id': 3085}, 'count': 1}\n",
      "{'_id': {'bikeid': 20835, 'end station id': 527}, 'count': 1}\n",
      "{'_id': {'bikeid': 23362, 'end station id': 499}, 'count': 1}\n",
      "{'_id': {'bikeid': 16078, 'end station id': 279}, 'count': 1}\n",
      "{'_id': {'bikeid': 17373, 'end station id': 3168}, 'count': 1}\n",
      "{'_id': {'bikeid': 23856, 'end station id': 480}, 'count': 1}\n",
      "{'_id': {'bikeid': 22955, 'end station id': 470}, 'count': 1}\n",
      "{'_id': {'bikeid': 22761, 'end station id': 519}, 'count': 1}\n",
      "{'_id': {'bikeid': 22176, 'end station id': 229}, 'count': 1}\n",
      "{'_id': {'bikeid': 24221, 'end station id': 3122}, 'count': 1}\n",
      "{'_id': {'bikeid': 23619, 'end station id': 438}, 'count': 1}\n",
      "{'_id': {'bikeid': 22419, 'end station id': 268}, 'count': 1}\n",
      "{'_id': {'bikeid': 15559, 'end station id': 494}, 'count': 1}\n",
      "{'_id': {'bikeid': 23306, 'end station id': 354}, 'count': 1}\n",
      "{'_id': {'bikeid': 22126, 'end station id': 331}, 'count': 1}\n",
      "{'_id': {'bikeid': 21379, 'end station id': 3134}, 'count': 1}\n",
      "{'_id': {'bikeid': 23491, 'end station id': 400}, 'count': 1}\n",
      "{'_id': {'bikeid': 17295, 'end station id': 411}, 'count': 1}\n",
      "{'_id': {'bikeid': 15331, 'end station id': 3127}, 'count': 1}\n",
      "{'_id': {'bikeid': 22734, 'end station id': 536}, 'count': 1}\n",
      "{'_id': {'bikeid': 24054, 'end station id': 3148}, 'count': 1}\n",
      "{'_id': {'bikeid': 23957, 'end station id': 500}, 'count': 1}\n",
      "{'_id': {'bikeid': 24071, 'end station id': 3155}, 'count': 1}\n",
      "{'_id': {'bikeid': 18246, 'end station id': 161}, 'count': 1}\n",
      "{'_id': {'bikeid': 17692, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 22948, 'end station id': 496}, 'count': 1}\n",
      "{'_id': {'bikeid': 17959, 'end station id': 348}, 'count': 1}\n",
      "{'_id': {'bikeid': 23664, 'end station id': 488}, 'count': 1}\n",
      "{'_id': {'bikeid': 18371, 'end station id': 526}, 'count': 1}\n",
      "{'_id': {'bikeid': 23984, 'end station id': 150}, 'count': 1}\n",
      "{'_id': {'bikeid': 19199, 'end station id': 324}, 'count': 1}\n",
      "{'_id': {'bikeid': 24769, 'end station id': 365}, 'count': 1}\n",
      "{'_id': {'bikeid': 19062, 'end station id': 446}, 'count': 1}\n",
      "{'_id': {'bikeid': 17714, 'end station id': 3242}, 'count': 1}\n",
      "{'_id': {'bikeid': 16441, 'end station id': 358}, 'count': 1}\n",
      "{'_id': {'bikeid': 22894, 'end station id': 428}, 'count': 1}\n",
      "{'_id': {'bikeid': 15932, 'end station id': 3074}, 'count': 1}\n",
      "{'_id': {'bikeid': 22998, 'end station id': 505}, 'count': 1}\n",
      "{'_id': {'bikeid': 15148, 'end station id': 459}, 'count': 1}\n",
      "{'_id': {'bikeid': 20741, 'end station id': 195}, 'count': 1}\n",
      "{'_id': {'bikeid': 23891, 'end station id': 3113}, 'count': 1}\n",
      "{'_id': {'bikeid': 14786, 'end station id': 3177}, 'count': 1}\n",
      "{'_id': {'bikeid': 23114, 'end station id': 160}, 'count': 1}\n",
      "{'_id': {'bikeid': 24232, 'end station id': 3147}, 'count': 1}\n",
      "{'_id': {'bikeid': 22661, 'end station id': 385}, 'count': 1}\n",
      "{'_id': {'bikeid': 16970, 'end station id': 489}, 'count': 1}\n",
      "{'_id': {'bikeid': 23362, 'end station id': 410}, 'count': 1}\n",
      "{'_id': {'bikeid': 17693, 'end station id': 3163}, 'count': 1}\n",
      "{'_id': {'bikeid': 24281, 'end station id': 2003}, 'count': 1}\n",
      "{'_id': {'bikeid': 22069, 'end station id': 503}, 'count': 1}\n",
      "{'_id': {'bikeid': 22725, 'end station id': 3113}, 'count': 1}\n",
      "{'_id': {'bikeid': 18816, 'end station id': 448}, 'count': 1}\n",
      "{'_id': {'bikeid': 23719, 'end station id': 504}, 'count': 1}\n",
      "{'_id': {'bikeid': 21290, 'end station id': 490}, 'count': 1}\n",
      "{'_id': {'bikeid': 24339, 'end station id': 511}, 'count': 1}\n",
      "{'_id': {'bikeid': 17998, 'end station id': 501}, 'count': 1}\n",
      "{'_id': {'bikeid': 17584, 'end station id': 480}, 'count': 1}\n",
      "{'_id': {'bikeid': 22083, 'end station id': 3070}, 'count': 1}\n",
      "{'_id': {'bikeid': 19041, 'end station id': 340}, 'count': 1}\n",
      "{'_id': {'bikeid': 17164, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 24019, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 15782, 'end station id': 498}, 'count': 1}\n",
      "{'_id': {'bikeid': 23353, 'end station id': 494}, 'count': 1}\n",
      "{'_id': {'bikeid': 22715, 'end station id': 531}, 'count': 1}\n",
      "{'_id': {'bikeid': 20183, 'end station id': 496}, 'count': 1}\n",
      "{'_id': {'bikeid': 17486, 'end station id': 369}, 'count': 1}\n",
      "{'_id': {'bikeid': 22018, 'end station id': 151}, 'count': 1}\n",
      "{'_id': {'bikeid': 21275, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 22223, 'end station id': 479}, 'count': 1}\n",
      "{'_id': {'bikeid': 16284, 'end station id': 3064}, 'count': 1}\n",
      "{'_id': {'bikeid': 17302, 'end station id': 467}, 'count': 1}\n",
      "{'_id': {'bikeid': 19858, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 19478, 'end station id': 514}, 'count': 1}\n",
      "{'_id': {'bikeid': 18856, 'end station id': 128}, 'count': 1}\n",
      "{'_id': {'bikeid': 20946, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 21420, 'end station id': 280}, 'count': 1}\n",
      "{'_id': {'bikeid': 16823, 'end station id': 438}, 'count': 1}\n",
      "{'_id': {'bikeid': 18371, 'end station id': 480}, 'count': 1}\n",
      "{'_id': {'bikeid': 19487, 'end station id': 528}, 'count': 1}\n",
      "{'_id': {'bikeid': 23636, 'end station id': 361}, 'count': 1}\n",
      "{'_id': {'bikeid': 17053, 'end station id': 3170}, 'count': 1}\n",
      "{'_id': {'bikeid': 19859, 'end station id': 512}, 'count': 1}\n",
      "{'_id': {'bikeid': 23545, 'end station id': 438}, 'count': 1}\n",
      "{'_id': {'bikeid': 22973, 'end station id': 257}, 'count': 1}\n",
      "{'_id': {'bikeid': 19226, 'end station id': 342}, 'count': 1}\n",
      "{'_id': {'bikeid': 22505, 'end station id': 3118}, 'count': 1}\n",
      "{'_id': {'bikeid': 16705, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 23471, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 14559, 'end station id': 363}, 'count': 1}\n",
      "{'_id': {'bikeid': 19068, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 15090, 'end station id': 257}, 'count': 1}\n",
      "{'_id': {'bikeid': 19631, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 24022, 'end station id': 3110}, 'count': 1}\n",
      "{'_id': {'bikeid': 22432, 'end station id': 403}, 'count': 1}\n",
      "{'_id': {'bikeid': 16764, 'end station id': 383}, 'count': 1}\n",
      "{'_id': {'bikeid': 23180, 'end station id': 379}, 'count': 1}\n",
      "{'_id': {'bikeid': 23426, 'end station id': 362}, 'count': 1}\n",
      "{'_id': {'bikeid': 19618, 'end station id': 3094}, 'count': 1}\n",
      "{'_id': {'bikeid': 23273, 'end station id': 360}, 'count': 1}\n",
      "{'_id': {'bikeid': 20588, 'end station id': 466}, 'count': 1}\n",
      "{'_id': {'bikeid': 24272, 'end station id': 253}, 'count': 1}\n",
      "{'_id': {'bikeid': 20648, 'end station id': 3224}, 'count': 1}\n",
      "{'_id': {'bikeid': 18580, 'end station id': 343}, 'count': 1}\n",
      "{'_id': {'bikeid': 23271, 'end station id': 3042}, 'count': 1}\n",
      "{'_id': {'bikeid': 22889, 'end station id': 291}, 'count': 1}\n",
      "{'_id': {'bikeid': 22715, 'end station id': 453}, 'count': 1}\n",
      "{'_id': {'bikeid': 17640, 'end station id': 504}, 'count': 1}\n",
      "{'_id': {'bikeid': 18222, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 23448, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 22861, 'end station id': 2004}, 'count': 1}\n",
      "{'_id': {'bikeid': 19276, 'end station id': 3110}, 'count': 1}\n",
      "{'_id': {'bikeid': 23697, 'end station id': 444}, 'count': 1}\n",
      "{'_id': {'bikeid': 15670, 'end station id': 168}, 'count': 1}\n",
      "{'_id': {'bikeid': 22161, 'end station id': 540}, 'count': 1}\n",
      "{'_id': {'bikeid': 23811, 'end station id': 507}, 'count': 1}\n",
      "{'_id': {'bikeid': 18788, 'end station id': 282}, 'count': 1}\n",
      "{'_id': {'bikeid': 23753, 'end station id': 350}, 'count': 1}\n",
      "{'_id': {'bikeid': 16879, 'end station id': 281}, 'count': 1}\n",
      "{'_id': {'bikeid': 24084, 'end station id': 377}, 'count': 1}\n",
      "{'_id': {'bikeid': 22486, 'end station id': 3002}, 'count': 1}\n",
      "{'_id': {'bikeid': 19525, 'end station id': 3148}, 'count': 1}\n",
      "{'_id': {'bikeid': 22568, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 15701, 'end station id': 3165}, 'count': 1}\n",
      "{'_id': {'bikeid': 18220, 'end station id': 479}, 'count': 1}\n",
      "{'_id': {'bikeid': 23860, 'end station id': 3222}, 'count': 1}\n",
      "{'_id': {'bikeid': 24021, 'end station id': 439}, 'count': 1}\n",
      "{'_id': {'bikeid': 23926, 'end station id': 529}, 'count': 1}\n",
      "{'_id': {'bikeid': 19671, 'end station id': 426}, 'count': 1}\n",
      "{'_id': {'bikeid': 23951, 'end station id': 326}, 'count': 1}\n",
      "{'_id': {'bikeid': 23082, 'end station id': 473}, 'count': 1}\n",
      "{'_id': {'bikeid': 17633, 'end station id': 491}, 'count': 1}\n",
      "{'_id': {'bikeid': 16122, 'end station id': 3163}, 'count': 1}\n",
      "{'_id': {'bikeid': 19748, 'end station id': 3129}, 'count': 1}\n",
      "{'_id': {'bikeid': 17057, 'end station id': 237}, 'count': 1}\n",
      "{'_id': {'bikeid': 23726, 'end station id': 195}, 'count': 1}\n",
      "{'_id': {'bikeid': 24040, 'end station id': 3167}, 'count': 1}\n",
      "{'_id': {'bikeid': 16229, 'end station id': 3137}, 'count': 1}\n",
      "{'_id': {'bikeid': 20637, 'end station id': 307}, 'count': 1}\n",
      "{'_id': {'bikeid': 22843, 'end station id': 161}, 'count': 1}\n",
      "{'_id': {'bikeid': 17342, 'end station id': 375}, 'count': 1}\n",
      "{'_id': {'bikeid': 19706, 'end station id': 285}, 'count': 1}\n",
      "{'_id': {'bikeid': 15259, 'end station id': 128}, 'count': 1}\n",
      "{'_id': {'bikeid': 23099, 'end station id': 401}, 'count': 1}\n",
      "{'_id': {'bikeid': 21588, 'end station id': 3177}, 'count': 1}\n",
      "{'_id': {'bikeid': 24271, 'end station id': 2021}, 'count': 1}\n",
      "{'_id': {'bikeid': 20258, 'end station id': 405}, 'count': 1}\n",
      "{'_id': {'bikeid': 19424, 'end station id': 300}, 'count': 1}\n",
      "{'_id': {'bikeid': 22981, 'end station id': 473}, 'count': 1}\n",
      "{'_id': {'bikeid': 19731, 'end station id': 383}, 'count': 1}\n",
      "{'_id': {'bikeid': 23477, 'end station id': 3118}, 'count': 1}\n",
      "{'_id': {'bikeid': 19557, 'end station id': 3175}, 'count': 1}\n",
      "{'_id': {'bikeid': 21317, 'end station id': 147}, 'count': 1}\n",
      "{'_id': {'bikeid': 24098, 'end station id': 293}, 'count': 1}\n",
      "{'_id': {'bikeid': 24503, 'end station id': 164}, 'count': 1}\n",
      "{'_id': {'bikeid': 23816, 'end station id': 465}, 'count': 1}\n",
      "{'_id': {'bikeid': 19639, 'end station id': 3047}, 'count': 1}\n",
      "{'_id': {'bikeid': 18292, 'end station id': 3050}, 'count': 1}\n",
      "{'_id': {'bikeid': 23147, 'end station id': 281}, 'count': 1}\n",
      "{'_id': {'bikeid': 19919, 'end station id': 403}, 'count': 1}\n",
      "{'_id': {'bikeid': 23554, 'end station id': 491}, 'count': 1}\n",
      "{'_id': {'bikeid': 19507, 'end station id': 305}, 'count': 1}\n",
      "{'_id': {'bikeid': 15715, 'end station id': 387}, 'count': 1}\n",
      "{'_id': {'bikeid': 23899, 'end station id': 342}, 'count': 1}\n",
      "{'_id': {'bikeid': 16721, 'end station id': 417}, 'count': 1}\n",
      "{'_id': {'bikeid': 15511, 'end station id': 497}, 'count': 1}\n",
      "{'_id': {'bikeid': 24102, 'end station id': 375}, 'count': 1}\n",
      "{'_id': {'bikeid': 22129, 'end station id': 2006}, 'count': 1}\n",
      "{'_id': {'bikeid': 19089, 'end station id': 280}, 'count': 1}\n",
      "{'_id': {'bikeid': 22761, 'end station id': 475}, 'count': 1}\n",
      "{'_id': {'bikeid': 18982, 'end station id': 3165}, 'count': 1}\n",
      "{'_id': {'bikeid': 24276, 'end station id': 435}, 'count': 1}\n",
      "{'_id': {'bikeid': 23358, 'end station id': 487}, 'count': 1}\n",
      "{'_id': {'bikeid': 23970, 'end station id': 483}, 'count': 1}\n",
      "{'_id': {'bikeid': 22344, 'end station id': 362}, 'count': 1}\n",
      "{'_id': {'bikeid': 23841, 'end station id': 521}, 'count': 1}\n",
      "{'_id': {'bikeid': 23402, 'end station id': 3177}, 'count': 1}\n",
      "{'_id': {'bikeid': 19808, 'end station id': 384}, 'count': 1}\n",
      "{'_id': {'bikeid': 22036, 'end station id': 327}, 'count': 1}\n",
      "{'_id': {'bikeid': 16475, 'end station id': 3231}, 'count': 1}\n",
      "{'_id': {'bikeid': 23326, 'end station id': 406}, 'count': 1}\n",
      "{'_id': {'bikeid': 23254, 'end station id': 217}, 'count': 1}\n",
      "{'_id': {'bikeid': 22089, 'end station id': 293}, 'count': 1}\n"
     ]
    }
   ],
   "source": [
    "for trip in trips.aggregate(pipeline):\n",
    "    pprint.pprint(trip)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

Introduction to MongoDB Week 02 Quiz Answers

Quiz 1: Data Types in MongoDB

Q1. Which of the following is true regarding data types in MongoDB?

  • By default MongoDB stores all numbers as doubles.
  • MongoDB has a special data type called ObjectId for uniquely identifying documents.
  • MongoDB supports many different data types, but you can’t query documents by type.
  • You should store money using the NumberDecimal (Decimal128) data type.

Quiz 2: Cleansing Data with Updates

Q1. For this assignment, you’re going to take a raw dataset, import it into MongoDB, cleanse the data in Python, and update MongoDB with the cleaned data.

Specifically, you’ll be taking a people dataset where some of the birthday fields look like this:12345{  ...  "birthday": ISODate("2011-03-17T11:21:36Z"),  ...}

And other birthday fields look like this:5}

MongoDB natively supports a Date datatype through BSON. This datatype is used in the first example, but a plain string is used in the second example. In this assessment, you’ll complete the attached notebook to script a fix that makes all of the document’s birthday field a Date.

  • cleansing-data-with-updates.ipynb
  • people-raw.json

Download the notebook and dataset to your notebook directory. Once you have the notebook up and running, and after you’ve updated your connection URI in the third cell, continue through the cells until you reach the fifth cell, where you’ll import the dataset. This can take up to 10 minutes depending on the speed of your Internet connection and computing power of your computer.

After verifying that all of the documents have successfully been inserted into your cluster, you’ll write a query in the 7th cell to find all of the documents that use a string for the birthday field.

To verify your understanding of the first part of this assessment, how many documents had a string value for the birthday field (the output of cell 8)?

Q2. For the second part of exercise you’re going to update the 9th cell in the notebook with the proper update operator to change the birthday field from a string to a date.

What is the correct operator to do this?

$put

$push

$change

$set

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Collecting dateparser\n",
      "\u001b[?25l  Downloading https://files.pythonhosted.org/packages/82/9d/51126ac615bbc4418478d725a5fa1a0f112059f6f111e4b48cfbe17ef9d0/dateparser-0.7.2-py2.py3-none-any.whl (352kB)\n",
      "\u001b[K    100% |████████████████████████████████| 358kB 666kB/s \n",
      "\u001b[?25hRequirement already satisfied: regex in /home/ragini/anaconda3/lib/python3.7/site-packages (from dateparser) (2019.8.19)\n",
      "Collecting tzlocal (from dateparser)\n",
      "  Downloading https://files.pythonhosted.org/packages/ef/99/53bd1ac9349262f59c1c421d8fcc2559ae8a5eeffed9202684756b648d33/tzlocal-2.0.0-py2.py3-none-any.whl\n",
      "Requirement already satisfied: pytz in /home/ragini/anaconda3/lib/python3.7/site-packages (from dateparser) (2018.9)\n",
      "Requirement already satisfied: python-dateutil in /home/ragini/anaconda3/lib/python3.7/site-packages (from dateparser) (2.8.0)\n",
      "Requirement already satisfied: six>=1.5 in /home/ragini/anaconda3/lib/python3.7/site-packages (from python-dateutil->dateparser) (1.12.0)\n",
      "Installing collected packages: tzlocal, dateparser\n",
      "Successfully installed dateparser-0.7.2 tzlocal-2.0.0\n"
     ]
    }
   ],
   "source": [
    "# We're going to install this module to help us parse datetimes from the raw dataset\n",
    "!pip install dateparser"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from pymongo import MongoClient, InsertOne, UpdateOne\n",
    "import pprint\n",
    "import dateparser\n",
    "from bson.json_util import loads"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Replace XXXX with your connection URI from the Atlas UI\n",
    "client = MongoClient(\"localhost\",27017)\n",
    "people_raw = client.cleansing['people-raw']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "batch_size = 1000\n",
    "inserts = []\n",
    "count = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# There are over 50,000 lines, so this might take a while...\n",
    "# Make sure to wait until the cell finishes executing before moving on (the * will turn into a number)\n",
    "with open(\"./people-raw.json\") as dataset: \n",
    "    for line in dataset: \n",
    "        inserts.append(InsertOne(loads(line)))\n",
    "        \n",
    "        count += 1\n",
    "                       \n",
    "        if count == batch_size:\n",
    "            people_raw.bulk_write(inserts)\n",
    "            inserts = []\n",
    "            count = 0\n",
    "if inserts:         \n",
    "    people_raw.bulk_write(inserts)\n",
    "    count = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ragini/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:2: DeprecationWarning: count is deprecated. Use estimated_document_count or count_documents instead. Please note that $where must be replaced by $expr, $near must be replaced by $geoWithin with $center, and $nearSphere must be replaced by $geoWithin with $centerSphere\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "50474"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Confirm that 50,474 documents are in your collection before moving on\n",
    "people_raw.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Replace YYYY with a query on the people-raw collection that will return a cursor with only\n",
    "# documents where the birthday field is a string\n",
    "people_with_string_birthdays = people_raw.find({'birthday':{'$type':'string'}})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ragini/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:2: DeprecationWarning: count is deprecated. Use Collection.count_documents instead.\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "1000"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# This is the answer to verify you completed the lab\n",
    "people_with_string_birthdays.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "updates = []\n",
    "# Again, we're updating several thousand documents, so this will take a little while\n",
    "for person in people_with_string_birthdays:\n",
    "    # Pymongo converts datetime objects into BSON Dates. The dateparser.parse function returns a\n",
    "    # datetime object, so we can simply do the following to update the field properly.\n",
    "    # Replace ZZZZ with the correct update operator\n",
    "    updates.append(UpdateOne({ \"_id\": person[\"_id\"] }, {'$set':{\"birthday\":dateparser.parse(person[\"birthday\"]) } }))\n",
    "    \n",
    "    count += 1\n",
    "                       \n",
    "    if count == batch_size:\n",
    "        people_raw.bulk_write(updates)\n",
    "        updates = []\n",
    "        count = 0\n",
    "        \n",
    "if updates:         \n",
    "    people_raw.bulk_write(updates)\n",
    "    count = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ragini/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:2: DeprecationWarning: count is deprecated. Use Collection.count_documents instead.\n",
      "  \n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# If everything went well this should be zero\n",
    "people_with_string_birthdays.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

Quiz 3: Sort, Skip, and Limit

Q1. Which of the following is true regarding sort, skip, and limit?

  • Sort accepts two arguments, the sort key and the direction to sort.
  • You can achieve pagination by using skip and limit together.
  • The skip method must come before the limit.
  • You can same time by using the limitAndSkip method which wraps the limit and skip methods.

Quiz 4: Querying movies using operators

Q1. Which of the following queries will match this movie document:15}

{
"_id": ObjectId("58c59c6a99d4ee0af9e0c32f"),
"title": "Akrobatisches Potpourri",
"year": 1895,
"imdbId": "tt0000011",
"genre": "Documentary, Short",
"viewerRating": 5.5,
"viewerVotes": 111,
"runtime": 1,
"director": "Max Skladanowsky",
"cast": [
"Grunato"
],
"plot": "Eight circus performers known as the Grunato family perform their famous balancing act."
}
  • db.movies.find( {“viewerRating”: {“$in” : [10, 5.5, 103, 200]}} )
  • db.movies.find( {“year”: {“$lt: 2015, “$gte” : 2000}} )
  • db.movies.find( {“genre”: {“$not” : [“Documentary”, “Short”]}} )
  • db.movies.find( {“year”: {“$lt” : 1962}} )
  • db.movies.find( {“tomatoes.userReviews”: {“$lte” : 2000}} )

Quiz 5: The $elemMatch Operator

Q1. Given a collection with the following documents:

{
“arr”: [
{ “a”: 1, “b”: 1 },
{ “a”: 2, “b”: 2 }
]
}

{
“arr”: [
{ “a”: 1, “b”: 2 },
]
}

{
“arr”: [
{ “a”: 2, “b”: 1 },
{ “a”: 1, “b”: 2 }
]
}

And given this query:1collection.find({"arr.a": 1, "arr.b": 2})

Which of the documents in the collection will be returned by the query above?

  • None of the documents.
  • Only documents 2 and 3.
  • Only document 1.
  • All 3 documents.

Quiz 6: Querying for Documents on an Array Field

Q1. In this assessment, you’re going to build 2 queries. Specifically, you’ll query for documents by an array field.

Go ahead and download the notebook attached and open it in Jupyter: querying-for-documents-on-an-array-field.

Your first query is against the movies collection in the mflix database. In this collection, documents have a cast field, which is an array. In the 4th cell write a filter document that will find documents whose cast field contain “Harrison Ford”. Hint: This query is simpler than it sounds.

What is the movie count (cell 5)?

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from pymongo import MongoClient\n",
    "import pprint"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# We're just reading data, so we can use the course cluster\n",
    "client = MongoClient('mongodb://analytics-student:[email protected]:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# We'll be using two different collections this time around\n",
    "movies = client.mflix.movies\n",
    "surveys = client.results.surveys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Replace XXXX with a filter document that will find the movies where \"Harrison Ford\" is a member of the cast\n",
    "movie_filter_doc = {\"cast\":\"Harrison Ford\"}\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "167"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# This is the first part of the answer to the lab\n",
    "movies.find(movie_filter_doc).count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'_id': ObjectId('5964e61ff0df64e7bc2d71e4'),\n",
      " 'results': [{'product': 'abc', 'score': 7.0},\n",
      "             {'product': 'xyz', 'score': 6.0}]}\n"
     ]
    }
   ],
   "source": [
    "for i in surveys.find({}):\n",
    "    pprint.pprint(i)\n",
    "    break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# Replace YYYY with a filter document to find the survey results where the \"abc\" product scored greater than 6\n",
    "survey_filter_doc = {\n",
    "  \"results\": {\n",
    "    \"$elemMatch\": {\n",
    "      \"product\": \"abc\",\n",
    "      \"score\": {\n",
    "        \"$gt\":6\n",
    "      }\n",
    "    }\n",
    "  }\n",
    "}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "295"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# This is the second part of the answer to the lab\n",
    "surveys.find(survey_filter_doc).count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}

Q2. Your second query is going to require some extra thinking. This time you should write a query against the surveys collection in the results database. The documents in this collection have an array field called results. The elements of this array field are documents of the form:1{ product: "XXX": score: Y }

In the 6th cell of the notebook, write a filter document that will return all of the documents where the results array contains a score greater than 6 for the product “abc”. Hint: You’ll be tempted to use dot notation to answer this question, but that’s not the correct way to write this query.

What is the survey count (cell 7)?

Enter your Answers 

Quiz 7: Querying on subdocuments

Q1. In MongoDB, if we have subdocuments we can …

  • …use the subdocuments to store data without limits.
  • …express queries using the fields of subdocuments.
  • …not nest another subdocument inside a subdocument.
  • …reduce the need for database joins.

Quiz 8: Inserting Comments in MFlix

Q1. Which of the following commands inserts one document on comments collection?

  • mflix.comments.update_many({ … }, {“$set”: {“updated”: true}})
  • mflix.comments.remove({ … })
  • mflix.comments.insert_one({ “a”: 1 }, false)
  • mflix.comments.insert_only_one({ “a”: 1 })
  • mflix.comments.insert_one({ “a”: 1})

Quiz 9: Updating Documents

Q1. Which of the following are update operators?

  • $add
  • $divide
  • $set
  • $inc
  • $push

Quiz 10: Deleting Data in MFlix

Q1. Which of the following statements are true regarding deleting documents in MongoDB?

  • The delete_many() method lets us delete many documents.
  • The remove_one() method lets us delete one document.
  • The remove_many() method lets us delete many documents.
  • The delete_one() method lets us delete one document.

Introduction to MongoDB Week 03 Quiz Answers

Quiz 1: MongoDB Indexes

Q1. Which of the following commands are valid index creation commands?

  • mflix.movies.create_index((“title”, pymongo.DESCENDING))
  • mflix.create_index( [ “title”, “year” ])
  • mflix.create_index(“movies”, “title”)

Quiz 2: Improve Query Performance

Q1. In this assessment, you’re going to perform an index-related operation in your Jupyter Notebook to increase the performance of your queries.

Go ahead and download the notebook attached and open it in Jupyter: improve-query-performance.ipynb.

You’ll need to fill in cell 7 with the appropriate index to increase the performance of the given queries.

Answer the following questions based on the outputs and code in your notebook:

What is the best single index to create to increase the performance of both queries?

Supply only the field of the index, not the full index name. For example, if the index name is first_name_1 then the answer would be first_name

last_name

Quiz 3: Geospatial Queries

Q1. Which of the following is true regarding geospatial queries and 2dsphere indexes?

  • When using $nearSphere, then $minDistance and $maxDistance operators are defined using meters.
  • The $centerSphere operator requires a 2dsphere index.
  • When making a query with $geoWithin and $centerSphere, the radius is defined using kilometers.
  • GeoJSON specifies coordinates as [<latitude>, <longitude>].

Quiz 4: Finding Things Nearby

Q1. In this lab, you’re going to leverage the power of MongoDB’s geospatial query engine.

For this lab, you’ll be utilizing the course cluster’s Citibike dataset.

Go ahead and download the notebook attached and open it in Jupyter: finding-things-nearby.ipynb.

After downloading the attached notebook, you’ll need to write a query in cell 4. This query should find all of the trips that started (start station location) within a half mile radius around MongoDB’s New York office. The latitude and longitude coordinates for MongoDB’s New York office are 40.75741088433861, -73.98782093364191.

Verify that you’ve completed the lab successfully by answer the following question:

How many trips started within a half mile from MongoDB’s New York office? (The output of cell 5)

REMEMBER: Distances expressed with MongoDB’s Geo features are in metres, so you’ll need to convert!

Enter your Answers

Quiz 5: Graphing with MongoDB

Q1. Which of the following is true regarding graphing with MongoDB?

  • A small amount of data transformation might be required after querying MongoDB to support matplotlib graphs.
  • Matplotlib’s 3D plots require an additional module to be imported.
  • The aggregation framework is required to create boxplots.
  • MongoDB natively supports the rendering of scatter plots via its query engine.

Quiz 6: Making Plots with Matplotlib & MongoDB

Q1. In this assessment, you’re going to take geographical data stored in MongoDB and plot it on a map using matplotlib.

For this exercise, we’ll be using the course cluster’s ships.shipwrecks collection. As the name implies, this dataset contains a variety of shipwrecks across the world. Your goal is to plot these shipwrecks, stored in MongoDB, onto a map of the world.

Go ahead and download the notebook attached and open it in Jupyter: mapping-geodata.

Plotting data with matplotlib, especially on a map, can be tedious and is out of scope for this course. The code to plot the shipwrecks has already been given to you in the attached notebook.

Your task is to transform the data we get out of MongoDB into the format that matplotlib expects. Specifically, this means you’ll need to convert a list of shipwreck documents into two arrays, each array containing the longitude and latitude values of the shipwrecks.

Each document in the ships.shipwrecks collection looks like:

{
"_id": ObjectId("578f6fa3df35c7fbdbaeea05"),
"recrd": "",
"vesslterms": "",
"feature_type": "Wrecks - Visible",
"chart": "US,US,graph,Chart 11553",
"latdec": 35.5390359,
"londec": -76.6260807,
"gp_quality": "",
"depth": "",
"sounding_type": "",
"yearsunk": "",
"history": "",
"quasou": "",
"watlev": "always dry",
"coordinates": [
-76.6260807,
35.5390359
]
}

You might notice that the coordinates of each shipwreck appear twice in the example document. Once in coordinates as an array of two values, and again in latdec and londec. Either set of values with work.

After adding your transformations to cell 6, which of the following images below matches your output from cell 7?

Choice 4

Q2. In this assessment, you will create a cartesian plot to examine correlation(s) between two variables.

You’ll be using a weather dataset stored in the course cluster under the 100YWeatherSmall database and the data collection. This data is from the United States National Oceanic and Atmospheric Administration (NOAA).

Go ahead and download the notebook attached and open it in Jupyter: creating-cartesian-plots.ipynb.

A single document looks something like this:

{
"_id": ObjectId("5553a98ce4b02cf7150dee5d"),
"st": "x+35500-030100",
"ts": ISODate("1984-01-01T00:00:00Z"),
"position": { "type": "Point", "coordinates": [ -30.1, 35.5 ] },
"elevation": 9999,
"callLetters": "PEOB",
"qualityControlProcess": "V020",
"dataSource": "4",
"type": "FM-13",
"airTemperature": { "value": 18.1, "quality": "1" },
"dewPoint": { "value": 999.9, "quality": "9" },
"pressure": { "value": 1028.8, "quality": "1" },
"wind": {
"direction": { "angle": 40, "quality": "1" },
"type": "N",
"speed": { "rate": 1, "quality": "1" }
},
"visibility": {
"distance": { "value": 20000, "quality": "1" },
"variability": { "value": "N", "quality": "9" }
},
"skyCondition": {
"ceilingHeight": { "value": 22000, "quality": "1", "determination": "C" },
"cavok": "N"
},
"sections": [ "AG1", "AY1", "GF1", "MW1" ],
"precipitationEstimatedObservation": { "discrepancy": "1", "estimatedWaterDepth": 0 },
"pastWeatherObservationManual": [
{
"atmosphericCondition": { "value": "0", "quality": "1" },
"period": { "value": 6, "quality": "1" }
}
],
"skyConditionObservation": {
"totalCoverage": { "value": "00", "opaque": "99", "quality": "1" },
"lowestCloudCoverage": { "value": "00", "quality": "1" },
"lowCloudGenus": { "value": "00", "quality": "1" },
"lowestCloudBaseHeight": { "value": 99999, "quality": "9" },
"midCloudGenus": { "value": "00", "quality": "1" },
"highCloudGenus": { "value": "00", "quality": "1" }
},
"presentWeatherObservationManual": [ { "condition": "02", "quality": "1" } ]
}

Your goal is to create a cartesian plot of atmospheric pressure (pressure.value) against air temperature (airTemperature.value). In the notebook, we’ve already taken care of connecting to the cluster, making the query, and transforming the data. You simply need to write the code in the last cell to actually plot the data.

To verify that you’ve successfully plotted the data, which of the following plots most closely matches your result?

Choice 3

Q3. In this assessment you will create a 3D plot to examine correlation(s) between three variables.

This exercise will be completed using the 100YWeatherSmall.data collection again.

Go ahead and download the notebook attached and open it in Jupyter: creating-3d-plots.ipynb.

Specifically, this time you’ll be plotting atmospheric pressure (pressure.value), air temperature (airTemperature.value), and wind speed (wind.speed.rate) against each other in a 3D plot.

Again, in the notebook we’ve already taken care of connecting to the cluster, making the query, and transforming the data. You simply need to write the code in the last cell to actually plot the data.

To verify that you’ve successfully plotted the data, which of the following plots most closely matches your result?

Q4. In this assessment, you’re going to leverage matplotlib’s statistical features to visualize the distribution of some data by building box plots.

In this case, we’ll be reusing the citibike.trips dataset. Here, we want to look at the distribution of trip lengths (tripduration) by day of the week for the month of January 2016.

Go ahead and download the notebook attached and open it in Jupyter: creating-box-plots.ipynb.

We’ve gone ahead and created an aggregation query to group the data by day of the week. The transformation of this data into a matplotlib format has also been taken care of for you.

You simply need to take the trip_durations_by_day matrix and turn it into a series of 7 box plots, each representing the distribution of trip durations for a given day of the week. You will create those plots in the last cell of the notebook.

To verify that you’ve successfully plotted the data, which of the following plots most closely matches your result?

Introduction to MongoDB Coursera Course Review:

In our experience, we suggest you enroll in the Introduction to MongoDB Coursera Course and gain some new skills from Professionals completely free and we assure you will be worth it.

introduction to MongoDB course is available on Coursera for free, if you are stuck anywhere between quiz or graded assessment quiz, just visit Networking Funda to get Introduction to MongoDB Coursera Quiz Answers.

Conclusion:

I hope this Introduction to MongoDB Coursera Quiz Answers would be useful for you to learn something new from this Course. If it helped you then don’t forget to bookmark our site for more Coursera Quiz Answers.

This course is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisite courses.

Keep Learning!

Leave a Reply

error: Content is protected !!