Check if mod exists to prevent empty query aggregates
This commit is contained in:
parent
0d2d55ca40
commit
a40c85065c
2 changed files with 3 additions and 2 deletions
|
@ -39,6 +39,7 @@ def q(**kwargs: dict) -> dict:
|
||||||
v = ObjectId(v)
|
v = ObjectId(v)
|
||||||
elif "__" in k:
|
elif "__" in k:
|
||||||
k, mod, *_ = k.split("__")
|
k, mod, *_ = k.split("__")
|
||||||
v = {f"${mod}": v}
|
if mod:
|
||||||
|
v = {f"${mod}": v}
|
||||||
query[k] = v
|
query[k] = v
|
||||||
return query
|
return query
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "jarvis-core"
|
name = "jarvis-core"
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Your Name <you@example.com>"]
|
authors = ["Your Name <you@example.com>"]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue