Commit db419887 authored by qinhaitao's avatar qinhaitao

fix: 🐛 $push

parent 901952c6
......@@ -66,7 +66,7 @@ export function formatUpdatedDataByProjection(dbData: any, projection: IPreUpdat
if (!isEmpty(projection.$push)) {
Object.keys(projection.$push).forEach(key => {
const originValue = get(key, updatedDbData) || []
set(key, [...originValue, projection.$push?.[key], updatedDbData])
set(key, [originValue, ...(projection.$push?.[key] || [])], updatedDbData)
})
}
return updatedDbData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment