Skip to content

Instantly share code, notes, and snippets.

@alexbevi
Last active May 31, 2021 19:28
Show Gist options
  • Save alexbevi/955c6675337107e16d637233f865b1e3 to your computer and use it in GitHub Desktop.
Save alexbevi/955c6675337107e16d637233f865b1e3 to your computer and use it in GitHub Desktop.
Mgeneratejs template
{
"a": {
"$integer": {
"min": 1,
"max": 100
}
},
"b": {
"$integer": {
"min": 1,
"max": 500
}
},
"c": {
"$integer": {
"min": 1,
"max": 1000
}
},
"d": {
"$integer": {
"min": 1,
"max": 5000
}
},
"e": {
"$integer": {
"min": 1,
"max": 10000
}
},
"numbers": {
"integer": "$integer",
"float": "$floating"
},
"array": {
"$array": {
"of": {
"$country": {
"full": true
}
},
"number": 5
}
},
"inc": {
"$inc": {
"start": 1,
"step": 1
}
},
"geojson": {
"point": "$point",
"linestring": "$linestring",
"polygon": "$polygon"
},
"native types": {
"binary": "$binary",
"date": "$date",
"numberLong": "$numberLong",
"timestamp": "$timestamp",
"regex": "$regex"
},
"chance": {
"ip_address": "$ip",
"unix time": "$hammertime"
},
"personal": {
"birthday": {
"$birthday": {
"type": "child"
}
},
"phone": "$phone",
"full name": {
"$name": {
"gender": "female"
}
},
"first name": "$first",
"last name": "$last",
"email": "$email",
"ssn": "$ssn",
"company": "$company",
"bb pin": "$bb_pin",
"url": {
"$url": {
"path": "images"
}
},
"urlfile": {
"$url": {
"extensions": [
"gif",
"jpg"
]
}
}
},
"text": {
"paragraph": {
"$paragraph": {
"sentences": 1
}
},
"sentence": {
"$sentence": {
"words": 5
}
}
}
}
{
"a": {
"$integer": {
"min": 1,
"max": 100
}
},
"b": {
"$integer": {
"min": 1,
"max": 500
}
},
"c": {
"$integer": {
"min": 1,
"max": 1000
}
},
"d": {
"$integer": {
"min": 1,
"max": 5000
}
},
"e": {
"$integer": {
"min": 1,
"max": 10000
}
},
"numbers": {
"integer": "$integer",
"float": "$floating"
}
}
@alexbevi
Copy link
Author

alexbevi commented Mar 25, 2020

curl -s https://gist.githubusercontent.com/alexbevi/955c6675337107e16d637233f865b1e3/raw/cca0390f6c30898140cc55490930b80c5cad527b/template.json | mgeneratejs -n 1000000 | mongoimport --collection data --numInsertionWorkers 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment