MCPcopy Index your code
hub / github.com/cloudgraphdev/cli / dropData

Method dropData

src/storage/dgraph/base.ts:70–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
69 // Drop All Data, but keep the schema.
70 async dropData(): Promise<ExecutionResult> {
71 return new Promise<ExecutionResult>(async (resolve, reject) => {
72 this.logger.debug('Dropping all data')
73 try {
74 const result = await this.generateAxiosRequest({
75 path: '/alter',
76 data: '{"drop_op": "DATA"}',
77 })
78 this.logger.debug(result.data)
79 this.logger.debug(`${chalk.green('dropData')}: Operation successful.`)
80 resolve(result)
81 } catch (error) {
82 this.logger.error(`${chalk.red('dropData')}: Operation failed.`)
83 this.logger.debug(JSON.stringify(error))
84 reject(error)
85 }
86 })
87 }
88}

Callers 1

runMethod · 0.80

Calls 1

generateAxiosRequestMethod · 0.95

Tested by

no test coverage detected