Fix delete for mongo < 3.2.
This commit is contained in:
parent
fe9c1dae14
commit
09ac174c63
|
@ -587,8 +587,12 @@ class Admin::SitePanelController < OrbitAdminController
|
|||
var user_query = {user_name: \"#{user_name}\"};
|
||||
user = db.users.findOne(user_query);
|
||||
if (user) {
|
||||
db.member_profiles.deleteOne({_id: user[\"member_profile_id\"]});
|
||||
db.users.deleteOne(user_query);
|
||||
var bulk = db.member_profiles.initializeUnorderedBulkOp();
|
||||
bulk.find({_id: user[\"member_profile_id\"]}).removeOne();
|
||||
bulk.execute();
|
||||
var bulk = db.users.initializeUnorderedBulkOp();
|
||||
bulk.find(user_query).removeOne();
|
||||
bulk.execute();
|
||||
}
|
||||
}()' {{db_name}}""".gsub(/\n|^ */,"")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue