@@ -14,26 +14,51 @@ var createUsers = function(opts) {
1414 } ) ) . pipe ( dest ) ;
1515} ;
1616
17- var createPaymentMethods = function ( opts ) {
17+ var createContactsNumber = function ( opts ) {
1818 var dest = new MongoWritableStream ( {
1919 url : opts . url ,
20- collection : 'payment_methods '
20+ collection : 'contacts '
2121 } ) ;
22- var src = fs . createReadStream ( __dirname + '/payment-methods.json' ) ;
22+ var src = fs . createReadStream ( __dirname + '/contacts-number.json' ) ;
23+ return src . pipe ( datasets . createGeneratorStream ( {
24+ size : 1000
25+ } ) ) . pipe ( dest ) ;
26+ } ;
27+ var createContactsString = function ( opts ) {
28+ var dest = new MongoWritableStream ( {
29+ url : opts . url ,
30+ collection : 'contacts'
31+ } ) ;
32+ var src = fs . createReadStream ( __dirname + '/contacts-string.json' ) ;
33+ return src . pipe ( datasets . createGeneratorStream ( {
34+ size : 1000
35+ } ) ) . pipe ( dest ) ;
36+ } ;
37+ var createContactsBoolean = function ( opts ) {
38+ var dest = new MongoWritableStream ( {
39+ url : opts . url ,
40+ collection : 'contacts'
41+ } ) ;
42+ var src = fs . createReadStream ( __dirname + '/contacts-boolean.json' ) ;
2343 return src . pipe ( datasets . createGeneratorStream ( {
2444 size : 1000
2545 } ) ) . pipe ( dest ) ;
2646} ;
27-
2847module . exports = function ( opts , done ) {
2948 opts = opts || { } ;
3049 opts . url = opts . url || 'mongodb://localhost:27017/datasets' ;
3150 async . parallel ( {
3251 users : function ( cb ) {
3352 createUsers ( opts ) . on ( 'end' , cb ) ;
3453 } ,
35- payment_methods : function ( cb ) {
36- createPaymentMethods ( opts ) . on ( 'end' , cb ) ;
54+ contacts_string : function ( cb ) {
55+ createContactsString ( opts ) . on ( 'end' , cb ) ;
56+ } ,
57+ contacts_number : function ( cb ) {
58+ createContactsNumber ( opts ) . on ( 'end' , cb ) ;
59+ } ,
60+ contacts_boolean : function ( cb ) {
61+ createContactsBoolean ( opts ) . on ( 'end' , cb ) ;
3762 }
3863 } , done ) ;
3964} ;
0 commit comments