Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get more info no this error? #14270

Closed
vkarpov15 opened this issue Jan 18, 2024 Discussed in #14267 · 0 comments
Closed

how to get more info no this error? #14270

vkarpov15 opened this issue Jan 18, 2024 Discussed in #14267 · 0 comments
Labels
developer-experience This issue improves error messages, debugging, or reporting

Comments

@vkarpov15
Copy link
Collaborator

Discussed in #14267

Originally posted by sibelius January 18, 2024
how to get more info no this error?

the document value looks correct, we don't have a path timestamp

CastError: Cast to date failed for value "NaN" (type number) at path "timestamp"
at SchemaDate.cast (/app/node_modules/mongoose/lib/schema/date.js:376:11)
at SchemaType.applySetters (/app/node_modules/mongoose/lib/schemaType.js:1219:12)
at SchemaDate.castForQuery (/app/node_modules/mongoose/lib/schema/date.js:410:17)
at castUpdateVal (/app/node_modules/mongoose/lib/helpers/query/castUpdate.js:569:19)
at walkUpdatePath (/app/node_modules/mongoose/lib/helpers/query/castUpdate.js:374:24)
at castUpdate (/app/node_modules/mongoose/lib/helpers/query/castUpdate.js:107:7)
at model.Query._castUpdate (/app/node_modules/mongoose/lib/query.js:4569:10)
at model.Query._findOneAndUpdate (/app/node_modules/mongoose/lib/query.js:3260:23)
at model.Query.exec (/app/node_modules/mongoose/lib/query.js:4290:80)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  stringValue: '"NaN"',
    messageFormat: undefined,
    kind: 'date',
    value: NaN,
    path: 'timestamp',
    reason: AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

    assert.ok(false)

  at castDate (/app/node_modules/mongoose/lib/cast/date.js:40:10)
  at SchemaDate.cast (/app/node_modules/mongoose/lib/schema/date.js:374:12)
  at SchemaType.applySetters (/app/node_modules/mongoose/lib/schemaType.js:1219:12)
  at SchemaDate.castForQuery (/app/node_modules/mongoose/lib/schema/date.js:410:17)
  at castUpdateVal (/app/node_modules/mongoose/lib/helpers/query/castUpdate.js:569:19)
  at walkUpdatePath (/app/node_modules/mongoose/lib/helpers/query/castUpdate.js:374:24)
  at castUpdate (/app/node_modules/mongoose/lib/helpers/query/castUpdate.js:107:7)
  at model.Query._castUpdate (/app/node_modules/mongoose/lib/query.js:4569:10)
  at model.Query._findOneAndUpdate (/app/node_modules/mongoose/lib/query.js:3260:23)
  at model.Query.exec (/app/node_modules/mongoose/lib/query.js:4290:80) {
    generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '=='
  },
  valueType: 'number'
}

can we add more info? document data, stacktrace from the place that happened this cast error

@vkarpov15 vkarpov15 added the developer-experience This issue improves error messages, debugging, or reporting label Jan 18, 2024
@vkarpov15 vkarpov15 added this to the 8.1.1 milestone Jan 18, 2024
@vkarpov15 vkarpov15 removed this from the 8.1.1 milestone Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience This issue improves error messages, debugging, or reporting
Projects
None yet
Development

No branches or pull requests

1 participant