SetJson. Deletion of the first zero in the string

Hello everyone!

I am facing a problem while trying set new data.


p_id: string @index(hash)

Trying set via SetJson:

  "set": [
    "uid": "_:p",
    "p_id": "0225100000118000273"

Leads me to this record in db (“225100000118000273”). No first zero.

While trying set via SetNquads:

  set {
    _:p <p_id> "0225100000118000273" .

Works just fine. (“0225100000118000273”)

Am i missing something?
Using SetJSON via goalng client is more comfortably for me. So i want to figure it out how to do it properly.
I can’t use “int” in schema, cuz it obviously do the same trick (which is make sense in numbers).
Also i could put “№” or other character before whole string(“№0225100000118000273”), but it feels like unnatural approach.

Alright, this seems a bug in JSON parser. Please fill up an issue. If work in RDF, should definitely work on JSON mutation.

1 Like

What version of Dgraph are you running? Type hinting in JSON mutations was removed in v1.0.11.


I am using 1.0.10 version right now . Thanks for your reply! I will update dgraph on my machine.
14 февр. 2019 г., 20:52 +0300, Daniel Mai via Discuss Dgraph, писал:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.