Skip to content

Instantly share code, notes, and snippets.

@aidan
Created December 7, 2011 11:40
Show Gist options
  • Save aidan/1442505 to your computer and use it in GitHub Desktop.
Save aidan/1442505 to your computer and use it in GitHub Desktop.
mongoengine test script
#!/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