Skip to content
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use a set for intersection
  • Loading branch information
Paul Jukic committed Oct 31, 2019
commit 1eb0c34da90fbb4e91f7026197d598fa8cbf6712
2 changes: 1 addition & 1 deletion mongorm/queryset/Q.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __or__( self, other ):
return self.do_merge( other, '$or' )

def __and__( self, other ):
if len( set( self.query.keys() ).intersection( list(other.query.keys()) ) ) > 0:
if len( set( self.query.keys() ).intersection( set( other.query.keys() ) ) ) > 0:
# if the 2 queries have overlapping keys, we need to use a $and to join them.
return self.do_merge( other, '$and' )
else:
Expand Down