[BUG] TypeMismatch: Expected createdAt to be of type date, instead found type object
See original GitHub issueSummary:
CloudWatch log
Doc on Dynamodb
Code sample:
Schema
const dynamoose = require("dynamoose");
const schema = new dynamoose.Schema({
email: {
type: String,
hashKey: true
},
github: Object,
name: String
}, {
saveUnknown: true,
timestamps: true
});
module.exports = dynamoose.model('User', schema);
General
const { User } = require('../db');
const user = await User.query('email').eq(email).exec();
Current output and behavior (including stack trace):
Cant query from dynamodb
Expected output and behavior:
I should be able to query from Dynamodb when I pass the pk value
Environment:
Operating System: NA - Lambda Function
Operating System Version: NA
Node.js version (node -v
): v10.19.0
NPM version: (npm -v
): 6.14.8
Dynamoose version: 2.3.0
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
- 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
- I have filled out all fields above
- I am running the latest version of Dynamoose
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
Expected 'property' to be of type string, instead found type object
My guess is that the problem could be related with the name of your attribute, model . In fact, this is the actual...
Read more >Schema - Dynamoose
The keys of this Schema object represent the name of the attributes, with the value allowing for customization such as changing the storage...
Read more >Error decoding parse-server response - ParseSwift SDK
I'm playing around with ParseSwift and a local Parse Server (4.5.0). Whenever I try to perform a query or saving an object to...
Read more >Failed to parse field of type in document with id ''. - Opster
You will find below our request and the error message we got back and extracted from the response object. PUT test/_doc/1.
Read more >AWS AppSync Developer Guide - Amazon S3
Now that you have an object type and can query the data, ... back to the Schema page in the AWS AppSync console...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AllanOricil Right now I don’t have enough information to be able to reproduce this and debug it.
Just for context. I ran the following code.
And got the following result:
From my perspective, everything is working fine. Please submit an MCVE as described in the contribution guidelines so I can debug this further.
I know this is a bit late. But there was no clear solution for the problem yet. So here I go: I had the same problem, same error message. I was using Local instance of DynamoDB so I deleted the tables using NoSQLWorkbench. Seems that I have made a change in the createdAt data type and it was conflicting with the previously saved schema.