-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
36 lines (26 loc) · 860 Bytes
/
index.ts
File metadata and controls
36 lines (26 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as mongoose from 'mongoose'
import { Mutator } from './utils/mutator';
import { paciente } from './schemas/patient';
/*Esta parte es para probar lo de mutantes*/
mongoose.connect('mongodb://10.1.62.17/migrasips');
let patients;
let cantidadMutantes = 10;
paciente.find({}, function (err, res) {
patients = res;
patients.forEach(
function(element, index){
//El valor de 30 mutantes a generar podría cambiarse. Por el momento mantengo el valor propuesto.
mutar(element, index, cantidadMutantes);
}
);
console.log("La mutación se ha realizado correctamente...");
}).limit(50);
function mutar(item, index,cantMutantes)
{
let mutator = new Mutator();
var i=0;
for(i=0;i<cantMutantes;i++){
var p = mutator.mutatePatient(item);
p.save();
}
}