Finding schemas that the data fulfils

但是很遗憾你无法找到schema的名字,所以还是不行。

TRANSLATION: but you can’t find the name of the schema, so, this is still no go.

how do you not know what the name of your schema predicate is?

你怎么可能找不到schema的名字??

没有看到有哪个地方定义schema的名字的,从界面上看,整个dgraph就是一个schema,请问哪个地方是定义schema本身的名字的?

OK. this is a whole other topic. Will split this thread.

Just to be clear,

You do not know where the schemas are defined. You just have the data, and you do not know what schemas describe what data. When you look into Ratel, all you see is one schema.

Can you share an example screenshot?

and the issue is you don’t know which schema a data belongs to?

两个问题:
第一个问题,不知道哪里定义schema的名字;
第二个问题,与第一个问题有关,由于不知道schema的名字,也不知道如何根据schema的名字来删除schema下的数据。

先看一下文档吧
不看文档闭着眼睛来瞎搞么

你怎么知道我闭着眼睛瞎搞呢。文档上没有啊。

https://dgraph.io/docs/query-language/schema/#adding-or-modifying-schema

schema {} 这个是查询所有schema,可以给里面加过滤条件.

定义schema, Ratel上可以.
你也可以通过API,

You can specify the flag runInBackground to true to run index computation in the background.

curl localhost:8080/alter?runInBackground=true -XPOST -d $'
    name: string @index(fulltext, term) .
    age: int @index(int) @upsert .
    friend: [uid] @count @reverse .
' | python -m json.tool | less
Grpc API
You can set RunInBackground field to true of the api.Operation struct before passing it to the Alter function.

op := &api.Operation{}
op.Schema = `
  name: string @index(fulltext, term) .
  age: int @index(int) @upsert .
  friend: [uid] @count @reverse .
`
op.RunInBackground = true
err = dg.Alter(context.Background(), op)

文档里都有

还有之前删数据的
https://dgraph.io/docs/slash-graphql/admin/drop-data/#sidebar

删除数据的也是删除所有的schema的数据,dropData(allDataAndSchema: true)。 这个能根据特定的schema来过滤吗?删除特定schema的数据?

https://dgraph.io/docs/clients/raw-http/
你可能需要第一种
curl -X POST localhost:8080/alter -d ‘{“drop_attr”: “name”}’

dgraph 支持gql, grahpql, 有些是属于graphql的方法,有些是gql的方法.gql是最全的.
graphql是稍微方便一点的.

这个仍然不是我需要的。我里面建立了几个不同的schema,在删除的时候一下子把里面所有的schema数据都给删除了,我只想删除特定schema的数据。类似于关系数据库里面的删除不同数据库的数据。

它没有不同的数据库
有Type,可以类比表的概念
你可以drop type

所以这就是我问问题的原因,看看能不能找到从这里找到答案。

稍等一下。。。有点忙. 一定会给你答案。

请问,有答案了吗?