var qm = require('qminer');
// create the base object
let base = new qm.Base({
mode: 'createClean',
schema: [
{
name: 'People',
fields: [
{ name: 'Name', type: 'string', primary: true },
{ name: 'Gender', type: 'string' }
],
}
]
});
let peopleStore = base.store('People');
// create a custom stream object
let ourStream = [];
// each element of the object has to comply to the base schema definition
ourStream.push(peopleStore.newRecord({ Name: 'John', Gender: 'Male' }));
ourStream.push(peopleStore.newRecord({ Name: 'Mary', Gender: 'Female' }));
ourStream.push(peopleStore.newRecord({ Name: 'Jill', Gender: 'Female' }));
ourStream.push(peopleStore.newRecord({ Name: 'Jack', Gender: 'Male' }));
ourStream.push(peopleStore.newRecord({ Name: 'Mary', Gender: 'Female' }));
ourStream.push(peopleStore.newRecord({ Name: 'Andy', Gender: 'Male' }));
ourStream.push(peopleStore.newRecord({ Name: 'Andy', Gender: 'Male' }));