I want to return true if a userID already exists and false otherwise from my collection.I have this function but it always returns True.
True
def alr
I guess am very late to post the solution. Anyways i have encountered same problem today and following worked for me. Hope this help to others.
return db.mycollection.find({'UserIDS': newID}).count > 0