question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SchemaError: No list schema given for attribute when saveUnknown is true

See original GitHub issue

Summary:

Getting error: SchemaError: No list schema given for attribute: sign when sign attribute has type [Object] and saveUnknown: true. Seems to work with other types like Array even if saveUnknown is enabled. I can’t use Array here though, cause this list will be populated with some objects in some cases.

Code sample:

Schema

const recSchema = new dynamoose.Schema({
  _id: {
    hashKey: true,
    required: true,
    type: String,
  },
  sign: {
    type: [Object],
  }
}, {
  saveUnknown: true,
});

Model

const Receipt = dynamoose.model('Receipt', recSchema, { update: true });

General

// Code here

Current output and behavior:

Getting the error below:

/home/userx/projecty/test-dynamo/node_modules/dynamoose/dist/Attribute.js:52
                throw new errors.SchemaError(`No list schema given for attribute: ${this.name}`);
                ^
SchemaError: No list schema given for attribute: sign
    at new Attribute (/home/userx/projecty/test-dynamo/node_modules/dynamoose/dist/Attribute.js:52:23)
    at Object.module.exports.create (/home/userx/projecty/test-dynamo/node_modules/dynamoose/dist/Attribute.js:673:18)
    at new Schema (/home/userx/projecty/test-dynamo/node_modules/dynamoose/dist/Schema.js:115:40)
    at Object.<anonymous> (/home/userx/projecty/test-dynamo/index.js:11:19)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)

Expected output and behavior:

Expected to know if that’s really a bug or some problem with my code.

Environment:

Operating System: Arch Linux Operating System Version: Linux arch 5.0.5-arch1-1-ARCH #1 SMP PREEMPT Wed Mar 27 17:53:10 UTC 2019 x86_64 GNU/Linux Node.js version (node -v): 9.8.1 NPM version: (npm -v): 5.6.0 Dynamoose version: 1.7.2 Dynamoose Plugins: No plugins used.

Dynamoose Plugins:

  • Yes, I believe that one or multiple 3rd party Dynamoose plugins are effecting this issue
  • No, I believe this issue is independent of any 3rd party Dynamoose plugins I’m using
  • Unknown, I’m unsure if Dynamoose plugins are effecting this issue
  • I am not using any Dynamoose plugins

Other information (if applicable):

Type (select 1):

  • Bug report
  • Feature suggestion
  • Question
  • Other suggestion
  • Something not listed here

Other:

  • [ x] I have read through the Dynamoose documentation before posting this issue
  • [ x] I have searched through the GitHub issues (including closed issues) and pull requests to ensure this issue has not already been raised before
  • [x ] I have searched the internet and Stack Overflow to ensure this issue hasn’t been raised or answered before
  • [ x] I have tested the code provided and am confident it doesn’t work as intended
  • [x ] I have ensured that all of my plugins that I’m using with Dynamoose are listed above
  • [ x] I have filled out all fields above
  • [ x] I am running the latest version of Dynamoose

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fishcharliecommented, Mar 3, 2020

@ElliottKoppRGA In the “docs” folder there is full documentation. Sadly other than the standard GitHub.com interface there isn’t a great way to view it currently.

If you have any ideas of how to improve it, a PR would be awesome.

1reaction
fishcharliecommented, Mar 2, 2020

@void666 This behavior has completely changed in version 2.0. I’d suggest playing around with it and leaving feedback on how it goes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No list schema given for attribute when saveUnknown is true ...
Summary: Getting error: SchemaError: No list schema given for attribute: sign when sign attribute has type [Object] and saveUnknown: true.
Read more >
Schema - Dynamoose
saveUnknown, array | boolean, false, This setting lets you specify if the schema should allow properties not defined in the schema. If you...
Read more >
Dynamoose List of Maps in schema - Stack Overflow
I have in my DynamoDB database a table containing an element as a List of Maps. Each Map item does not ...
Read more >
OpenLDAP schema error - Server Fault
ldapadd loads LDIF files, you're trying to load a schema file. Either load the LDIF version of the schema if it's available or...
Read more >
KeySchemaElement - Amazon DynamoDB
Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found