dynamoose: .scan parse error saveUnknown
I’m trying to get Dynamoose to scan and return all items without really defining a schema. I don’t really want to define a schema because I’m using this code in another application that is a secondary application.
At first I had the following code:
// define the schema for our model
var theSchema = new dynamoose.Schema({}, { saveUnknown: true });
// create the model for projects and expose it to our app
var model = dynamoose.model('mytablea', theSchema);
That produced an error that said TypeError: Cannot read property 'name' of undefined.
Then just to test things I tried to change theSchema to the following:
// define the schema for our model
var theSchema = new dynamoose.Schema({_id: String}, { saveUnknown: true });
That produced an error that said SyntaxError: Unexpected token F in JSON at position 0.
The second time it actually called the exec function with that error. First time Dynamoose just throw that error and didn’t even call that exec function.
Any ideas on how to fix this?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 25 (25 by maintainers)
I think I’ll leave alone for release 0.8 and see if any other have the same issue.