       :localField "gid"
       :foreignField "from"
       :as "to"}}
-    {:$project {:to {:$filter {:input "$to" :as "o" :cond {:$eq ["$$o.label" label]}}}}}
+    {:$project
+     {:history "$_history"
+      :to
+      {:$filter
+       {:input "$to"
+        :as "o"
+        :cond
+        {:$eq ["$$o.label" label]}}}}}
     {:$unwind "$to"}
+    {:$addFields {"to._history" "$history" "to.yellol" "1333"}}
     {:$replaceRoot {:newRoot "$to"}}]
    where))
 

      :foreignField "gid"
      :as "from"}}
    {:$unwind "$from"}
    {:$replaceRoot {:newRoot "$from"}}]
   where))


      :localField "gid"
      :foreignField "to"
      :as "from"}}
    {:$project
     {:history "$_history"
      :to
      {:$filter
       {:input "$from"
        :as "o"
        :cond
        {:$eq ["$$o.label" label]}}}}}
    {:$unwind "$from"}
    {:$addFields {"from._history" "$history"}}
    {:$replaceRoot {:newRoot "$from"}}]
   where))

