jus101 / feathers-dynamodb Goto Github PK
View Code? Open in Web Editor NEWFeathers AWS DynamoDB service
License: MIT License
Feathers AWS DynamoDB service
License: MIT License
Please resolve the find operation with NeDB compatible format, ie. a structure containing "data", but also "total", "limit" and "skip"
return nfcall(q, 'exec').then(data => {
return {
total,
limit: filters.$limit,
skip: filters.$skip || 0,
data
};
For instance $or does not work
Like here to check whether one of SenderId or ReceiverId matches Id
hook.params.query = {
$or: [
{ SenderId: Id },
{ ReceiverId: Id }
]
};
see https://github.com/feathersjs/docs/blob/master/api/databases/querying.md for the needed support
Hello,
In some cases we need to use conditional creation like in dynamodb example:
var params = {};
params.ConditionExpression = '#i <> :x';
params.ExpressionAttributeNames = {'#i' : 'id'};
params.ExpressionAttributeValues = {':x' : 123};
User.create({id : 123, name : 'Kurt Warner' }, params, function (error, acc) { ... });
In the same time, we are not using params object passed to create service so we could imagine something like:
create (data, params) {
return new Promise((resolve, reject) => {
this.Model.create(data, **params**, (err, doc) => {
if (err) return reject(err);
return resolve(doc ? (isArray(doc)? map(doc, (d) => d.get()) : doc.get() ): undefined);
});
});
}
First there is a problem with
if (!params.query) in line 70, which does not work if query === {}, it should be if (param.query === undefined)
Second, scan operation (it's the only one I tested) does not resolve. Line 77 returns a ReadableStream, but never reads from the and nothing is resolved for the promise
See the attached hacked diff (somehow "close" is not triggered). My feeling is that this library has not been tested enough - none of the service's stanard methods are contained in the test script here.
Hi, can you add some code/README how to connect to an existing real AWS Table?
Hi Justin,
There is a bug when trying to create an array of items:
TypeError: doc.get is not a function
at Model.create (/Users/adnene/Projets/cortex/node_modules/feathers-dynamodb/index.js:97:34)
at /Users/adnene/Projets/cortex/node_modules/async/lib/async.js:52:16
at /Users/adnene/Projets/cortex/node_modules/async/lib/async.js:361:13
at /Users/adnene/Projets/cortex/node_modules/async/lib/async.js:52:16
at done (/Users/adnene/Projets/cortex/node_modules/async/lib/async.js:246:17)
at /Users/adnene/Projets/Phileas/node_modules/async/lib/async.js:44:16
at /Users/adnene/Projets/Phileas/node_modules/async/lib/async.js:358:17
at /Users/adnene/Projets/Phileas/node_modules/dynamodb/lib/table.js:199:14
at Response.<anonymous> (/Users/adnene/Projets/cortex/node_modules/dynamodb/lib/table.js:72:14)
at Request.<anonymous> (/Users/adnene/Projets/cortex/node_modules/aws-sdk/lib/request.js:354:18)
Expected behaviour would be to return created array.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.