Created
December 7, 2011 11:40
-
-
Save aidan/1442505 to your computer and use it in GitHub Desktop.
mongoengine test script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from mongoengine import * | |
class Noddy(Document): | |
fields = DictField() | |
def main(): | |
connect("test", port=27019) | |
Noddy.drop_collection() | |
for i in range (100000): | |
noddy = Noddy() | |
for j in range (20): | |
noddy.fields["key"+str(j)] = "value "+str(j) | |
noddy.save() | |
myNoddys = Noddy.collection.find() | |
for noddy in myNoddys: | |
print noddy | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment