This commit is contained in:
BoHung Chiu 2022-11-17 00:33:48 +08:00
parent 497c32685a
commit fe9c1dae14
1 changed files with 3 additions and 3 deletions

View File

@ -625,9 +625,9 @@ class Admin::SitePanelController < OrbitAdminController
member = db.member_profiles.update(member_query, {$set: member_data}); member = db.member_profiles.update(member_query, {$set: member_data});
}else{ }else{
var bulk = db.member_profiles.initializeUnorderedBulkOp(); var bulk = db.member_profiles.initializeUnorderedBulkOp();
bulk.find(member_query).upsert().updateOne(member_data); bulk.insert(member_data);
var result = bulk.execute(); bulk.execute();
user_data.member_profile_id = result.getUpsertedIds()[0][\"_id\"]; user_data.member_profile_id = bulk.getOperations()[0][\"operations\"][0][\"_id\"];
db.users.update(user_query, {$set: user_data}); db.users.update(user_query, {$set: user_data});
} }
}()' {{db_name}}""".gsub(/\n|^ */,"") }()' {{db_name}}""".gsub(/\n|^ */,"")