fast way to load mongodb data into python list

Solutions on MaxInterview for fast way to load mongodb data into python list by the best coders in the world

showing results for - "fast way to load mongodb data into python list"
Rosalie
02 Sep 2019
1import pymongo
2import numpy as np
3""" Connection ...."""
4movie_raw = db["collection"].find({})
5""" Loading """
6count = movie_raw=count()
7data_arr = np.empty(count, dtype=...)
8for index, movie in enumnerate(movie_raw):
9  data_arr[i] = movie
10""" Saves alot of time instead of # list(movie_raw) # when loading large DBs """