Grokking MongoDB
0% completed
Drop an Index
Every index on a collection can be removed except one, the index that MongoDB creates on _id. The examples build the products collection again with these indexes, and the partial index has no recorded use:
db.products.drop() db.products.insertMany([ { name: "Apple", category: "Fruit", price: 1.2 }, { name: "Carrot", category: "Vegetable", price: 0.8 }, { name: "Banana", category: "Fruit", price: 1.1 }, { name: "Broccoli", category: "Vegetable", price: 1.5 }, { name: "Grapes", category: "Fruit", price: 2.0 } ]) db.products
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%