.find() method resulting incorrect query for the embedded model. The query should be (@player1_username:{username})| (@player2_username:{username}), but the query output is like (@player1_player2_username:{username})| (@player1_player2_username:{loadtest1}) that eventually returns a wrong output.
The following code can reproduce the issue
class Player(EmbeddedJsonModel):
username: str = Field(index=True)
class Game(JsonModel):
player1: Optional[Player]
player2: Optional[Player]
q = Game.find((Game.player1.username=='username') | (Game.player2.username=='username'))
print(q.query)
Can someone guide me on how to resolve this issue?
.find()
method resulting incorrect query for the embedded model. The query should be(@player1_username:{username})| (@player2_username:{username})
, but the query output is like(@player1_player2_username:{username})| (@player1_player2_username:{loadtest1})
that eventually returns a wrong output.The following code can reproduce the issue
Can someone guide me on how to resolve this issue?