Answers for "mongoose if empty string is provided use default"

0

mongoose if empty string is provided use default

const objFromUser = { 'test' : '', 'test2' : 'test2' }
if (!objFromUser.test) delete objFromUser.test
const model = new MyModel(objFromUser)
Posted by: Guest on April-01-2020

Code answers related to "mongoose if empty string is provided use default"

Code answers related to "Javascript"

Browse Popular Code Answers by Language