Skip to content

Instantly share code, notes, and snippets.

@andrewmkhoury
Last active May 10, 2018 20:50
Show Gist options
  • Save andrewmkhoury/685db2146a01710964ef to your computer and use it in GitHub Desktop.
Save andrewmkhoury/685db2146a01710964ef to your computer and use it in GitHub Desktop.
How to use oak-mongo.js to delete an index
  1. Stop all Oak cluster nodes (or AEM6 cluster nodes)
  2. On the mongo server, run these commands to log in to mongo shell with oak-mongo.js loaded wget http://svn.apache.org/repos/asf/jackrabbit/oak/trunk/oak-run/src/main/js/oak-mongo.js mongo 127.0.0.1/aem-author --shell oak-mongo.js
  3. In the mongo shell run this command to get a list of all index names oak.listChildren("/oak:index")
  4. In the mongo shell run this where indexname is the name of the index you are deleting. oak.removeDescendantsAndSelf("/oak:index/indexname")
  5. Start all Oak nodes (or AEM6 nodes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment