Thank you Anthony!
We have tried version 20.11.3 to version 21.03.2. These all have type function problems, but we haven’t used the latest 21.12.0 version yet.
We tried to use version 20.11.0 to rewrite our data and found another proplem.
(Hope @MichelDiz can help us out! )
For example, we have 5 million person type nodes.
each person node have a person_name predicate and only person type node has this person_name predicate.
So we have the following two ways to find the total number of person type nodes.
{
res(func: type(person)){
count(uid)
}
}
{
res(func: has(person_name)){
count(uid)
}
}
But The result we query through these two methods is not the same.
The result using type is about 1600 less than using has.
Next we use the following query tried to check if there is problem with our data,
{
res(func: has(person_name)) @filter(not type(<person>)) {
count(uid)
dgraph.type
}
}
I can get the missing 1600 nodes,
But these nodes actually have the dgraph.type attribute of "person"
Based on this, we judged that there must be something wrong with the type() query
The above experiments were all completed in version 20.11.0 ,
Also is there any different between using “eq(dgraph.type, “person”)” and “type()”?
In newer version ,if there is a type() function error, neither method is available anymore.