The checkNote method from the Notes.js file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async checkNote(title) { | |
const dbConnection = await this.createConnection(); | |
return dbConnection.collection('notes_db').findOne({ title }).then((doc) => { | |
if (doc) { | |
return true; | |
} else { | |
return false; | |
} | |
}).catch((e) => { | |
console.log('*********** Error ***********'); | |
console.log(`ErrorName: ${e.name}`); | |
console.log(`errorMessage: ${e.message}`); | |
console.log('*********** Error ***********'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment