Class: Lexster::NeoDatabaseCleaner

Inherits:
Object
  • Object
show all
Defined in:
lib/lexster/database_cleaner.rb

Class Method Summary collapse

Class Method Details

.clean_db(start_node = Lexster.db.get_root) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/lexster/database_cleaner.rb', line 3

def self.clean_db(start_node = Lexster.db.get_root)
  Lexster.db.execute_script <<-GREMLIN
    g.V.toList().each { if (it.id != 0) g.removeVertex(it) }
    g.indices.each { g.dropIndex(it.indexName); }
  GREMLIN

  true
end