一个小而基本的包,用于创建随机mongodb文档和简单的加载。

MongoRandomizer的Python项目详细描述


MongodaTarandomizer

这是一个简单的数据randoizer,可以用数据加载mongodb数据库。

安装

来自Pypi

  • pip install MongoRandomizer

来源

  • 下载源代码
  • cd到下载目录
  • 运行pip install --editable .

使用

帮助

graboskycMBP:~ graboskyc$ MongoRandomizer -h
usage: MongoRandomizer [-h] [-c CS] [-t T] [-b B] [-m M] [-p P] [-w WC] [-j]
                       [-g]
                       task

CLI Tool for continually writing random data to a MongoDB database for testing
purposes

positional arguments:
  task              clean, insert, insertAndUpdate, read, everything

optional arguments:
  -h, --help        show this help message and exit
  -c CS             server connection string
  -t T              threads to use, if left off, use 10
  -b B              blocksize to use. if not inclided, use 1000
  -m M              max blocks to use. if not inclided, use 1000
  -p P              additional chars of padding to increase document size
  -w WC             write concern to use. if blank, none used
  -j, --journaling  if omitted, false. if flag enabled, journal
  -g, --geo         if omitted, use customer data. if flag enabled push
                    geographic data

随机插入

graboskycMBP:~ graboskyc$ MongoRandomizer -c mongodb://localhost -t 5 -b 500 -p 10 -w 1 -j insert

About to enter data in: 
	Threads: 5
	DB: demodb
	Collection: democollection
	Blocksize: 1000
	Max Blocks: 500
	Write Concern: 1
	Journaling: True

This process will continue until you press control+c or break

示例文档

{
	"_id" : ObjectId("5b7db58ecc39345cebc78f67"),
	"prescriptions" : [
		"Drug water adult.",
		"Enjoy month.",
		"Just always wind summer.",
		"Bad street me.",
		"Assume.",
		"Section.",
		"Forward nearly.",
		"Town community boy.",
		"Vote major.",
		"Walk.",
		"Left night receive.",
		"Relationship speak.",
		"Affect nearly.",
		"Present star special.",
		"Employee instead.",
		"Kid foot direction poor.",
		"Determine law."
	],
	"accountNumber" : 48,
	"padding" : "aaaaaaaaaa",
	"address" : "847 Ferguson Rd.",
	"payment" : 60,
	"occupation" : "Aid worker",
	"singupDate" : ISODate("2018-08-22T19:11:55.442Z"),
	"copay" : 20,
	"notes" : "Crime evening nation artist blue far fast generation. Play list range none before night everyone. Doctor make score around.",
	"zipcode" : "43418",
	"state" : "WY",
	"fullname" : "Donna Webster",
	"deductible" : 300
}

地理文件样本

{
	"_id" : ObjectId("5b9fd129cc39341758236d80"),
	"padding" : "",
	"notes" : "Wait mean performance view billion plan civil this. Cup prevent season.\nEffect thought while get market war wife oil.",
	"name" : "Mr. Antonio Salas MD",
	"location" : {
		"type" : "Point",
		"coordinates" : [
			-73.59354663520122,
			42.00216814289992
		]
	}
}

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
将Java中的对象列表序列化为json   在同一Play Framework项目中同时使用Ebean和JPA的java   oop如何在整个Java项目中共享API密钥   java ADT Eclipse SDK故障未找到DDM   扫描程序中变量的递归Java输入值未应用于方法中的变量   java将空格转换为命令行类型的空格   JavaSpring,如何决定客户机应该使用哪个服务?   java致命异常:main(Android标准)   java编译错误是因为类型检查还是三元运算符?   java Sikuli+Webdriver:getting error x.png看起来像一个文件,但在磁盘上找不到。假设是文本   java选择位置。。。。ms sql 2005中需要电气状态   由于OSGi捆绑包依赖性问题,java无法启动RCP应用程序   json java gson fromjson返回非泛型的null   如何将google api访问令牌从java服务器传递到gapi javascript客户端?   java在已排序的LinkedList中添加元素   java ForkJoinPool为什么程序抛出OutOfMemoryError?   java SQUARE无法解析为Processing/Eclipse中的变量   java如何为Sun App Server 8.2设置JNDI