Skip to content

key: with number type -> type mismatch #596

Description

@Matan-Perry

Hi!

I am trying to define a table with an integer as the key.

  class Model
    include Dynamoid::Document

    table name: "table_name", key: :my_key, capacity_mode: :on_demand

    field :my_field, :integer
  end

In my schema i define my_key to be the partition key. when my_key is a string everything work's great, but when i change the schema to :

            attribute_definitions: [
              {
                attribute_name: "my_key",
                attribute_type: "N",  ## (Was S)
              },

I am getting :

     Aws::DynamoDB::Errors::ValidationException:
       One or more parameter values were invalid: Type mismatch for key

I couldn't find any example with a number type key. is this supported?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions