我是新来的Dgraph,我的头对一个简单的问题与dgraph。我甚至搜索过github源代码,但我显然错过了我正在寻找的东西。
在dgraph接口中,我可以运行以下查询:
schema(pred: [name]) {
type
index
}甚至只是
schema {}若要获取有关数据库的架构信息,请执行以下操作。但是在dgraph中,如果我使用查询事务,它可以正常运行:
const res = await this.connection.newTxn().query(`query {
getData(func: regexp(name, /.*mic+.*/i)) {
name
}
}`);
const data = res.getJson();但是,运行以下命令:
const res = await this.connection.newTxn().query(`schema {}`);
const data = res.getJson();返回空对象。我怀疑我不应该使用newTxn().query(),而应该使用其他的东西。它应该是一个新的dGraph.Operation()吗?或者别的什么?我在哪里可以看到所有可用的功能?dgraph (https://github.com/dgraph-io/dgraph-js)上的自述文件只提供了这么多信息.
发布于 2018-11-13 16:11:47
https://stackoverflow.com/questions/53266883
复制相似问题