Getting double values for integer facets

Posted by akshanshjain95:


I have done a mutation in Dgraph using dgraph4j. The JSON used for mutation is given below -

    "employeeName": "Akshansh",
    "number": 23,
    "worksFor": {
      "companyName": "Knoldus Inc.",
      "worksFor|employeeNo": 1

When I try to retrieve the employeeNo facet stored as the property of worksFor edge, I get a value of 1.000000, whereas the stored value is 1. If I try to retrieve number which is a property of a node, I get 23.

Furthermore, if I run the same mutation using ratel, something like below -

  set {
    <_:akshansh> <worksFor> <_:knoldus>(employeeNo=1) .
    <_:akshansh> <number> "23" .
    <_:knoldus> <companyName> "Knoldus Inc." .
    <_:akshansh> <employeeName> "Akshansh" .

and I try to retrieve the value of employeeNo, I get the value of 1, which is as expected.

Schema used is as below -

employeeName: string @index(exact) .
worksFor: uid .
companyName: string .
employeeNo: int .
number: int .

So, is there an issue while mutating the data in dgraph using dgraph4j? Any reason as to why is dgraph client showing this behavior? Thanks!