Alternative for Pymongo cursor iteration
问题 I went through many cursor iterationn questions, but saw nothing which can solve my problem. I have a database of the form [{book:'A', author:'John'}, {book:'B', author:'Tony'}, {book:'C', author:'John'}...] Multiple books for same author possible. What I need is 2 arrays authors = ['John','Tony','John'] books = ['A','B','C'] where corresponding elements falls at same index in both arrays. Now I am getting it by cursor iteration. authors =[] books =[] cursor = collection.find() for elem in