Q:

Find by key and return value or null

To find a record by a key and return a property of it:
this.db('settings').find({ name : 'option1' }).value

But if the record doesn't exist I get an error "Cannot read property 'value' of undefined"
is there some other method that is able to return the "value" property if the record exists, or null if it doesn't exist?

A:

this.db('settings').find({name: 'option1'}, function(err, result){
    if(err){console.log(err)}

    if(result){
        // do stuff 
    }
})

