1. 程式人生 > >mongodb以background方式建立索引

mongodb以background方式建立索引

Background Construction

For potentially long running index building operations, consider the background operation so that the MongoDB database remains available during the index building operation. For example, to create an index in the background of the zipcode field of the people collection, issue the following:

db.people.createIndex( { zipcode: 1}, {background: true} )