Git Product home page Git Product logo

feathers-dynamodb's People

Contributors

c10h22 avatar jus101 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

feathers-dynamodb's Issues

resolve find method with NeDB-compatible format

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
        };

Allow conditional parameters in create request

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);
      });
    });
  }

Scan does not work

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.

feathers-dynamodb.diff.txt

Production Example

Hi, can you add some code/README how to connect to an existing real AWS Table?

doc.get is not a function when trying to create an array of items

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.