0

find() official link

for doc in db.tasks.find(filter={'state':'successful'},projection=['analysis.bandgap'])‌​: 
    print doc 

I tried to set projection as a list or dict, but neither will work for limit the output of find(). How to set projection properly?

styvane
  • 59,869
  • 19
  • 150
  • 156
keliu
  • 41
  • 3
  • How did you do it? show us your code. – styvane Apr 30 '16 at 06:39
  • @user3100115 Thank you. A shorten code is as followed: `for doc in db.tasks.find(filter={'state':'successful'},projection=['analysis.bandgap'])‌​: print doc` – keliu May 01 '16 at 06:53
  • please add sample documents with the expected result using the [edit](https://stackoverflow.com/posts/36943425/edit) link – styvane May 01 '16 at 06:56

0 Answers0