Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from couchdb import Server
- import random
- import string
- from random import randint
- server = Server() # local server
- db = server['testdb']
- # random data
- for idx in range(1, 5000):
- doc = {
- "sort": str(randint(0, 1000)),
- "val": ''.join(random.choices(string.ascii_uppercase + string.digits, k=8))
- }
- db.save(doc)
- # potential matches
- for idx in range(1, 50):
- for val in ["aaaa", "aaa", "aa", "a"]:
- doc = {
- "sort": str(randint(0, 1000)),
- "val": val
- }
- db.save(doc)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement