Reputation: 319
I use Firebase with Vue.js. Here I save to the database with this command:
saveEvent(){
db.collection('events').add({
title: this.title,
content: this.content,
start: this.start,
end: this.end,
split: this.split,
})
this.events.push(this.data)
}
Everything is saved as string, but I would like to save 'split' as a number.
do you have any suggestions for solutions?
Upvotes: 0
Views: 177
Reputation: 1549
try doing split: Number(this.split)
to cast a string into number.
Upvotes: 1