views:

71

answers:

1

I am using PyMongo and Mongo version db version v1.4.1, pdfile version 4.5

When I try to query the database I am always getting different results. The code looks like this:

familycollection = conn.picdata
pics = familycollection[place]
pictures = [i for i in pics.find()]
return pictures

However pictures doesn't full return all my data. There are 8 total elements in the collection and I am getting sometimes a full response and other times a small response.

>>> len(pictures)
4
>>> pics.count()
5
>>> for i in range(10):
...     pics.count()
...
5
5
5
6
7
8
8
8
8
8

Any help?

Thanks, James

A: 

After working on this for a while I realized I was doing the reads too fast and needed to wait a little time.

James