0.1.2 • Published 11 years ago
redis-mapper v0.1.2
##redis-mapper
Create models, save objects, and find them later.
This project currently only works with objects one layer deep utilizing strings. Other primitives will be added along with sub objects and arrays.
##Model
CustomerModel = mapper.modelFactory('Customer',
{
first_name: '',
last_name: ''
}
);
##Save
CustomerModel.save(
{
first_name: 'thomas',
last_name: 'silva'
},
function(id) {
}
);
##Find
CustomerModel.find(
[{type: 'string', attribute: 'first_name', value: 'thomas'}], function(customer) {
console.log(customer.first_name);
}
);