twisted / txmongo

asynchronous python driver for mongo
https://txmongo.readthedocs.io
Apache License 2.0
338 stars 102 forks source link

Retrieve the number of versions of any given file #200

Closed oddjobz closed 8 years ago

oddjobz commented 8 years ago

This seems like missing critical functionality, once you start building versions of a given file, you really need (at some point) to be able to determine how many versions of that file you have. Cycling through previous would seems to be a horribly inefficient mechanism. This method is 'better', although maybe someone with a better grasp of txmongo's internals could improve it .. for now tho' it provides the functionality and I've added a basic test to show it works.

psi29a commented 8 years ago

Nice...

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.02%) to 95.2% when pulling f3f68b8ac9d87c4a9cb2b4a1c0fc30567b800469 on oddjobz:master into da3870ef897f2f128c95a941c5e2378db8766d7e on twisted:master.

oddjobz commented 8 years ago

Ok, how's that look now? :)

IlyaSkriblovsky commented 8 years ago

Cool! But test_GFSNoCount can be simplified by removing try..except :)

oddjobz commented 8 years ago

Like that?

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.005%) to 95.189% when pulling c4130ac4d70463dfe7ce35ee6aa7eeba27dc6d58 on oddjobz:master into da3870ef897f2f128c95a941c5e2378db8766d7e on twisted:master.

oddjobz commented 8 years ago

:)

IlyaSkriblovsky commented 8 years ago

I'll merge your code when testing is finished. Thanks for contribution!

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.005%) to 95.189% when pulling 9406ac0bb828c46b113d5d5dd8f05930f7c69e4f on oddjobz:master into da3870ef897f2f128c95a941c5e2378db8766d7e on twisted:master.

psi29a commented 8 years ago

Thanks very much for this! :)