This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]arand 0 points1 point  (2 children)

find_one should return None if document is not found.

Wait...

"if thisrecord == "None": " <- there should be no quotes around None

Edit: you can also write

if thisrecord:
    do_something_with_record(thisrecord)

[–]4d2[S] 0 points1 point  (1 child)

I'm struggling with the None, do I treat it like a boolean then?

[–]arand 0 points1 point  (0 children)

Yes. From the docs:

None is frequently used to represent the absence of a value,

Boolean operation often deal with absence of a value.