GithubHelp home page GithubHelp logo

dynamite's People

Contributors

adrianlee44 avatar chaosgame avatar chrisronline avatar dependabot[bot] avatar eduardoramirez avatar giannic avatar jfuchs avatar jimmyoneill avatar kylehg avatar kylewm avatar majelbstoat avatar mikkot avatar mrblackus avatar nicks avatar ox avatar sboora avatar thatjoemoore avatar vinibaggio avatar xiao avatar

Stargazers

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

Watchers

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

dynamite's Issues

Support for M and L AttributeValue

I'm fairly new to DynamoDB and looking to migrate from our native aws library usage to this library.

I'm seeing an issue where our data types with attribute values M or L are throwing an unsupported error and it doesn't seem like they are supported but they exist in the official docs as valid types.

Am I missing something?

Thanks

P.S. It seems it would be fairly simple to support, something like:

case 'M':
  var mapped = {};
  for (var k in obj.M) {
    mapped[k] = objectToValue(obj.M[k]);
  }
  return mapped;
case 'L':
  return obj.L.map(objectToValue);

ReturnValues

Currently dynamite returns ALL_NEW, it would be good to set this option on the query builder to return what is needed from the query.

Valid Values: NONE | ALL_OLD | UPDATED_OLD | ALL_NEW | UPDATED_NEW

getItem requires range key

I have a table that has a hashKey (userId), but no range key. I want to retrieve the user by userId, but I'm getting an error that Range Key is required.

Switch to aws-sdk 2.0

I now it wasn't released yet (2.0.0-rc6) but it's close. I am just curious when do you plan that. Thank you.

FakeDynamo limit behavior differs from real Dynamo

In Dynamo, the limit parameter of queries and scans limits the number of rows that are examined before filtering. In FakeDynamo the limit is applied only after filtering, so it can return many more results than Dynamo would.

Using objects

Hi, my team is about to use your Client for DynamoDB, but we need all required functionality, exactly manipulating objects. AWS support using nested objects without converting them to string. As I can see, you have PR, dealing with it, but we'd like to use stable version, produced by you. Fix this small issue, we would appreciate that. Thanks for you attention!

Question: getting last n inserted items?

Thanks for this handy lib. I'm new to DynamoDB, I would like to simply get the last 10 (for example) items inserted into a given table. How do I go about building the query?

Question about expectAttributeAbsent

Hi !

I try to use Dynamite but i'm lost.

How I can check that a username is not taken by another user? I tried with expectAttributeAbsent but it does not work. An idea ?

Thank you :)

`app.post('/signup', function (req, res) {
  var user = req.body.user;

  user.userId = uuidV4();
  user.provider = 'local';

  var conditions = client.newConditionBuilder()
    .expectAttributeAbsent('username',user.username) // if the username doesn't exist in the database

  client.putItem('user-table', user)
    .withCondition(conditions)
    .execute()
    .then(function(data){
      console.log(data)
      res.json('work')
    })
    .fail(function(e) {
      console.log(e);
      res.status(500).json({ error: e });
    })
})`

cc @nicks

goog.labs.Promise instead of Kew

Can be Kew replaced with a new goog.labs.Promise? Since I am using Closure code in Node.js, this would be fine improvement. Can I help somehow?

Support Map data type

Any specific reason why the Map data type is not supported by this library?

I have just started using the library and would love support for this feature. Maybe someone could explain the complexity involved in adding support.

how to use this library with lambda?

when i import this library to my lambda in serverless project, this error shows up

module initialization error: TypeError
at Object.<anonymous> (/var/task/discounts/router.js:648:79)
at __webpack_require__ (/var/task/discounts/router.js:20:30)
at Object.defineProperty.value (/var/task/discounts/router.js:597:15)
at __webpack_require__ (/var/task/discounts/router.js:20:30)
at Object.<anonymous> (/var/task/discounts/router.js:255:23)
at __webpack_require__ (/var/task/discounts/router.js:20:30)
at Object.defineProperty.value (/var/task/discounts/router.js:63:18)
at Object.<anonymous> (/var/task/discounts/router.js:66:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)

Returning Kew with async/await

Is this library compatible with generators or ES6's async/await syntax? If would it be possible to define our own promise library at runtime?

How to put and update boolean values?

When I try to create new item which is containing boolean value, it gives me boolean validation error and I don't know what I'm doing wrong. Are there any other proper way to do it?

var data = {....};
data['id'] = uuid.v4();
data['verified'] = true;
client.putItem('UsersTable', data)
.execute()
.then(function(r) {
})
.fail(function(reason) {
console.log(reason);
});

The error is
{ [InvalidParameterType: Expected params.Item['verified'].BOOL to be a boolean] message: 'Expected params.Item['verified'].BOOL to be a boolean', code: 'InvalidParameterType', time: Mon Nov 09 2015 06:13:21 GMT+0000 (UTC) }

FakeDynamo cannot find local index if there are no conditions

If I build a query with an index name but without any filter conditons, e.g.

new QueryBuilder()
  .setTableName('Users')
  .setHashKey('userId', ...)
  .setIndexName('isAdmin-index')
  .execute()

FakeDynamo doesn't know which attribute that corresponds to

FakeTable.prototype.query = function(data) {
  var indexedKeyName
  if (data.IndexName) {
    // Global Secondary Index if the index name has three or more
    // parts (separated by '-')
    var indexParts = data.IndexName.split('-')
    var probableGSIIndex = indexParts.length >= 3
    if (probableGSIIndex) {
      return this._queryGlobalSecondaryIndex(data)
    }

    // Extract the range key for Local Secondary Indexes
    for (var key in data.KeyConditions) {
      if (key !== this.primaryKey.hash.name) {
        indexedKeyName = key
      }
    }
  }
  ...

and (silently) fails to find anything as a result.

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.