How can i insert more then digit number into my database and what is the prefer datatype

582 views
Skip to first unread message

Code Panda

unread,
Jun 28, 2017, 5:00:01 AM6/28/17
to Sequelize
Hi There , I am use sequelize js(for mysql)  with express js and i try to insert a mobile number something like +919999956666. it doesn't insert a current value..
How to fix this ... THanks in Advance 
my code look like this ... 
mobileNumber:{
type:Sequelize.BIGINT,
unique:true,
allowNull:false,
validate:{
not:{
args:["[a-z]",'i'],
msg:"Please enter a valid number"
},
len:{
args:[10,20],
msg:"Min length of the phone number is 10"
}
}
},

Mick Hansen

unread,
Jun 28, 2017, 5:00:50 AM6/28/17
to Code Panda, Sequelize
`+` is not a valid integer, you'd need to do some kind of parsing.
--
Mick Hansen
@mhansendev
mhansen.io

Code Panda

unread,
Jun 29, 2017, 1:38:45 AM6/29/17
to Sequelize
@mhansendev
thanks for reply @mhansendev. yes  your are correct and '+' is not number what I did to overcome this issue  i just remove the + and then insert into db. Still i getting the same issue.
Reply all
Reply to author
Forward
0 new messages