I am using mongodb to build an app which get the user's twitter timeline in a mongodb database, I want to check if the tweets I got from twitter has already existed in my database, so I use the mongodb.find()
function.
The whole function is like this:
db.collection.find({'twitterIAlreadyStored.id_str': newTweet.id_str}
Then I want to write a logical code which is:
if(exist){
} else {
}
So I am wondering if there is any way to test if the result of find exists or not??