From fe9c1dae146f92eae25ee811cad66873cdd0e0c7 Mon Sep 17 00:00:00 2001 From: bohung Date: Thu, 17 Nov 2022 00:33:48 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/site_panel_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/site_panel_controller.rb b/app/controllers/admin/site_panel_controller.rb index 8c1833b..aec3221 100644 --- a/app/controllers/admin/site_panel_controller.rb +++ b/app/controllers/admin/site_panel_controller.rb @@ -625,9 +625,9 @@ class Admin::SitePanelController < OrbitAdminController member = db.member_profiles.update(member_query, {$set: member_data}); }else{ var bulk = db.member_profiles.initializeUnorderedBulkOp(); - bulk.find(member_query).upsert().updateOne(member_data); - var result = bulk.execute(); - user_data.member_profile_id = result.getUpsertedIds()[0][\"_id\"]; + bulk.insert(member_data); + bulk.execute(); + user_data.member_profile_id = bulk.getOperations()[0][\"operations\"][0][\"_id\"]; db.users.update(user_query, {$set: user_data}); } }()' {{db_name}}""".gsub(/\n|^ */,"")