Giter Club home page Giter Club logo

Comments (3)

cdhowie avatar cdhowie commented on July 22, 2024 1

@Serjkee Deletion in the docs already provides an example of deleting a record where the schema has a range key. I'm not sure what else we could add to the section to make that clearer.

I don't think that explicitly stating "make sure your schema is correct" makes much sense; we'd have to do that multiple times all over the documentation. I think it's a reasonable assumption that your schema should be correct; if it's not, all sorts of other problems might also happen.

As requested I'll close this issue. Let us know if you run into any other problems.

from dynogels.

cdhowie avatar cdhowie commented on July 22, 2024

@Serjkee I cannot reproduce this bug. I created a DynamoDB table using this same schema and was able to successfully create and then destroy the example record (after changing timestamp to be a string, as declared in the schema).

The line commentsModel.destroy(receivedObj._id, console.log); ran without error (null was logged indicating no error) and the record was removed from the table, as expected.

Usually you see "The provided key element does not match the schema" when the value is not of the expected type; e.g. it's null, undefined, or is an object that is missing the required key value(s). (For example, if your table has a range key then you would see this error because you only provided the hash key.)

Please give us a complete test case along with a working schema that can be used to create a DynamoDB table that exactly matches your DynamoDB table.

from dynogels.

Serjkee avatar Serjkee commented on July 22, 2024

Hi @cdhowie

Thanks for the such fast response. I've managed to successfully resolve this one. The issue was with that i didn't specify rangeKey in my schema. In the docs we can see that rangeKey must be passed so i tried, but without specifying it in my schema. It wasn't clear for me at the first glance from the delete section in docs, so the issue is made on my own :)

Is it a good idea to add for delete (and update) in the description block: 'You delete items in DynamoDB using the hashkey of model If your model uses both a hash and range key, then both need to be provided' something like "Ensure that the rangeKey is specified in your schema"? Possibly, I'm not the one who made such mistake :) What do you think?

Once again, thanks for your help. The issue can be closed :)

from dynogels.

Related Issues (20)

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.