I'm trying to implement a custom sails-dynamodb adapter, similar to this one but compatible with the new Sails version v1.0.
I got stuck in implementing the find() function, trying to use the passed map of conditions (the query.criteria.where parameter), to build a dynamic query to the Dynamodb database using Vogels library.
If I try building the query manually it works:
model.scan().where('email').equals('xyz@abc.com').exec((err, result) => {
if (err) {
sails.log.error(err);
} else {
sails.log.info(result);
}
});
But what I'm trying to achieve is something similar to this:
model.scan({email: 'xyz@abc.com'}).exec((err, result) => {
if (err) {
sails.log.error(err);
} else {
sails.log.info(result);
}
});
Sails version v1.0.2
Vogels version v2.2.0