Skip to content

Commit

Permalink
Remove deprecated index option background from createIndexes.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jan 4, 2023
1 parent 4dba660 commit fc725b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/batchVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
await database.createIndexes([{
collection: 'tokenization-batchVersion',
fields: {'batchVersion.id': 1},
options: {unique: true, background: false}
options: {unique: true}
}, {
// do not reuse a tokenizer across multiple versions to ensure
// version creation can be automated when tokenizers auto-rotate
collection: 'tokenization-batchVersion',
fields: {'batchVersion.tokenizerId': 1},
options: {unique: true, background: false}
options: {unique: true}
}, {
// there can be only one set of options, used for new versions as
// they are auto-generated, uses `BATCH_OPTIONS_ID` as the single `id`
collection: 'tokenization-batchVersionOptions',
fields: {'batchVersionOptions.id': 1},
options: {unique: true, background: false}
options: {unique: true}
}]);

// insert default version options from config, ignoring duplicates
Expand Down
3 changes: 1 addition & 2 deletions lib/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
// justified
collection: 'tokenization-registration',
fields: {'registration.externalIdHash': 1, 'registration.documentHash': 1},
options: {unique: true, background: false}
options: {unique: true}
}, {
// automatically expire registrations with an `expires` date field
collection: 'tokenization-registration',
fields: {'registration.expires': 1},
options: {
unique: false,
background: false,
expireAfterSeconds: 0
}
}]);
Expand Down
2 changes: 1 addition & 1 deletion lib/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
// value uniquely identifies an entity, so its shard key is `internalId`
collection: 'tokenization-entity',
fields: {'entity.internalId': 1},
options: {unique: true, background: false}
options: {unique: true}
}, {
// automatically expire entities with an `expires` date field
collection: 'tokenization-entity',
Expand Down
5 changes: 2 additions & 3 deletions lib/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,13 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
this must be its shard key. */
collection: 'tokenization-tokenBatch',
fields: {'tokenBatch.id': 1},
options: {unique: true, background: false}
options: {unique: true}
}, {
// automatically expire token batches with an `expires` date field
collection: 'tokenization-tokenBatch',
fields: {'tokenBatch.expires': 1},
options: {
unique: false,
background: false,
expireAfterSeconds: 0
}
}, {
Expand All @@ -76,7 +75,7 @@ bedrock.events.on('bedrock-mongodb.ready', async () => {
'pairwiseToken.internalId': 1,
'pairwiseToken.requester': 1
},
options: {unique: true, background: false}
options: {unique: true}
}]);
});

Expand Down

0 comments on commit fc725b9

Please sign in to comment.