skip to Main Content

Node.js+MongoDB can't save hashed password

I am trying to save password in MongoDB but have error: Error: User validation failed: password: Path `password` is required. Model: const {Schema, model} = require('mongoose'); const UserSchema = new Schema({ email: {type: String, unique: true, required: true}, password: {type:…

VIEW QUESTION

Mongodb – Getting error node BSONTypeError: Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer value:Array

I am working on a node js project where I am getting the following error : CastError: Cast to ObjectId failed for value "[ [ '63e8e6e8b8a285d68b1fbd0c', '63e9951ded54221a516fc622' ] ]" (type Array) at path "labels" because of "BSONTypeError" at ObjectId.cast (/var/www/html/IssueTracker/node_modules/mongoose/lib/schema/objectid.js:248:11)…

VIEW QUESTION
Back To Top
Search