Skip to content

Commit

Permalink
Add DocumentDB compatibility to fetch_links (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitfin authored Oct 8, 2024
1 parent 1a897a8 commit ac1da37
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions beanie/odm/utils/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def construct_query(
}
},
{
"$set": {
"$addFields": {
link_info.field_name: {
"$cond": {
"if": {
Expand All @@ -81,7 +81,7 @@ def construct_query(
}
}
},
{"$unset": f"_link_{link_info.field_name}"},
{"$project": {f"_link_{link_info.field_name}": 0}},
] # type: ignore
new_depth = (
current_depth - 1 if current_depth is not None else None
Expand Down Expand Up @@ -122,7 +122,7 @@ def construct_query(
}
},
{
"$set": {
"$addFields": {
link_info.field_name: {
"$cond": {
"if": {
Expand All @@ -137,7 +137,7 @@ def construct_query(
}
}
},
{"$unset": f"_link_{link_info.field_name}"},
{"$project": {f"_link_{link_info.field_name}": 0}},
]
new_depth = (
current_depth - 1 if current_depth is not None else None
Expand Down Expand Up @@ -172,7 +172,7 @@ def construct_query(
}
},
{
"$set": {
"$addFields": {
link_info.field_name: {
"$cond": {
"if": {
Expand All @@ -187,7 +187,7 @@ def construct_query(
}
}
},
{"$unset": f"_link_{link_info.field_name}"},
{"$project": {f"_link_{link_info.field_name}": 0}},
] # type: ignore
new_depth = (
current_depth - 1 if current_depth is not None else None
Expand Down Expand Up @@ -231,7 +231,7 @@ def construct_query(
}
},
{
"$set": {
"$addFields": {
link_info.field_name: {
"$cond": {
"if": {
Expand All @@ -246,7 +246,7 @@ def construct_query(
}
}
},
{"$unset": f"_link_{link_info.field_name}"},
{"$project": {f"_link_{link_info.field_name}": 0}},
]
new_depth = (
current_depth - 1 if current_depth is not None else None
Expand Down

0 comments on commit ac1da37

Please sign in to comment.