Previous Next JavaScript must be enabled to correctly display this content

## UpdateJSON.createIndex()

The `UpdateJSON.createIndex()` method creates a JSON index in the store. It must be run before UpdateJSON.updateTableWithIndex() is run.

For information on JSON indexes, see JSON Indexes.

        // Creates a JSON index. This method must be
        // run before updateTableWithIndex() is run.
        private void createIndex(KVStore kvstore) {
            System.out.println("Creating index....");
            String statement = "CREATE INDEX IF NOT EXISTS ";
            statement += "idx_home_city on personContacts ";
            statement += "(person.address.home.city AS String)";
            runDDL(kvstore, statement);
        }