Skip to content

Commit

Permalink
Story 11250: Update deprecated remove method in the mongo shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
GiooDev committed Oct 30, 2023
1 parent a92e23d commit 031573e
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ db.contexts.updateOne(


{% macro insertCertififcate(pemFile, contextId) -%}
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ db.contexts.updateOne(


{% macro insertCertififcate(pemFile, contextId) -%}
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ db.contexts.updateOne(


{% macro insertCertififcate(pemFile, contextId) -%}
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
18 changes: 9 additions & 9 deletions deployment/scripts/mongod/1.0.0/01_iam_ref.js.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ db = db.getSiblingDB('iam')

print("START 01_iam_ref.js");

db.users.remove({});
db.groups.remove({});
db.profiles.remove({});
db.tenants.remove({});
db.providers.remove({});
db.owners.remove({});
db.customers.remove({});
db.sequences.remove({});
db.tokens.remove({});
db.users.deleteMany({});
db.groups.deleteMany({});
db.profiles.deleteMany({});
db.tenants.deleteMany({});
db.providers.deleteMany({});
db.owners.deleteMany({});
db.customers.deleteMany({});
db.sequences.deleteMany({});
db.tokens.deleteMany({});
db.createCollection('events');
db.createCollection('operations');

Expand Down
2 changes: 1 addition & 1 deletion deployment/scripts/mongod/1.0.0/02_security_ref.js.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ db = db.getSiblingDB('security')

print("START 02_security_ref.js");

db.contexts.remove({});
db.contexts.deleteMany({});
db.createCollection('events');

db.contexts.insertOne({
Expand Down
2 changes: 1 addition & 1 deletion deployment/scripts/mongod/1.0.0/03_application_ref.js.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
db = db.getSiblingDB('{{ mongodb.iam.db }}')

db.applications.remove({});
db.applications.deleteMany({});

db.applications.insertOne({
"identifier" : "CUSTOMERS_APP",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ db = db.getSiblingDB('{{ mongodb.security.db }}')
print("START security.populate_certificates_ref.js");

{% macro insertCertificate(pemFile, contextId, host) -%}
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ host }}_{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ db = db.getSiblingDB('{{ mongodb.security.db }}')
print("START 224_security.populate_certificates_pastis.js.j2");

{% macro insertCertificate(pemFile, contextId, host) -%}
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ host }}_{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ db = db.getSiblingDB('{{ mongodb.security.db }}')
print("START 315_security.populate_certificates_ref.js");

{% macro insertCertificate(pemFile, contextId, host) -%}
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ host }}_{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ db = db.getSiblingDB('iam')

print("START 04_add_default_external_parameters_profile.js.j2");

db.externalParameters.remove({});
db.externalParameters.deleteMany({});
db.createCollection('externalParameters', { autoIndexId: true });

var maxIdProfile = db.getCollection('sequences').findOne({ '_id': 'profile_identifier' }).sequence;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ db = db.getSiblingDB('{{ mongodb.archivesearch.db }}')

print("START 06_create_search_criteria_history.js");

db.searchCriteriaHistories.remove({});
db.searchCriteriaHistories.deleteMany({});
db.createCollection('searchCriteriaHistories', {autoIndexId: true});

print("END 06_create_search_criteria_history.js");
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ db.groups.aggregate([
});

//======== DELETE OLD PROFILES FOR APP ARCHIVE_SEARCH_MANAGEMENT_APP ========//
db.profiles.remove(
db.profiles.deleteMany(
{
$and: [
{ "applicationName": "ARCHIVE_SEARCH_MANAGEMENT_APP" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ print("START 002_RABB-1262_add_iam_internal.populate_certificates_ref.js");
db = db.getSiblingDB('security')

{% macro insertCertificate(pemFile, contextId, host) -%}
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ host }}_{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ print("START 6.rc.0/04_update_certificates_collection_with_collect_certificate.j

{% macro insertCertificate(pemFile, contextId, host) -%}

db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
db.certificates.remove(
db.certificates.deleteOne(
{"_id" : "{{ host }}_{{ pemFile | basename | replace('.pem','_cert')}}"},
{ justOne: true }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ db = db.getSiblingDB('{{ mongodb.archivesearch.db }}')

print("START 08_create_search_criteria_history_collect.js");

db.searchCriteriaHistoriesCollect.remove({});
db.searchCriteriaHistoriesCollect.deleteMany({});
db.createCollection('searchCriteriaHistoriesCollect', {autoIndexId: true});

print("END 08_create_search_criteria_history_collect.js");

0 comments on commit 031573e

Please sign in to comment.