You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IndexDefinitiondefinition = newIndex()
.on("field", Sort.Direction.ASC)
.background();
mongoOperations.indexOps(IndexedClass.class).ensureIndex(indexDefinition);
mongoOperations.indexOps(IndexedClass.class).getIndexInfo();
// No way to validate whether background option exists on the index
After reading through this part of the Mongo docs it seems that since version 4.2 the background index property has no effect.
Deprecated: In MongoDB 4.0 and earlier, users could control whether to build indexes in the foreground (blocking) or background (non-blocking, but less efficient) using the background option.
class Person
include Mongoid::Document
field :ssn
index({ ssn: 1 }, { unique: true, background: true })
end
The default value of background is controlled by Mongoid's background_indexing configuration option.
The background option has no effect as of MongoDB 4.2.
While working with
MongoOperations
andIndexOperations
, and it hard to validate when an index has been created with background or not.Mongo version: 7.0.12
SpringData MongoDB version: 4.2.4
Simple Java Code:
Looking at Mongo, it seems to keep track of it:
Please include
background
property to IndexInfoThe text was updated successfully, but these errors were encountered: