What version of Dgraph are you using?
1.2.1
Have you tried reproducing the issue with the latest release?
No
What is the hardware spec (RAM, OS)?
Not relevant
Steps to reproduce the issue (command/config used to run Dgraph).
Create 1.schema:
type Floor {
name
open
<~building.floors>
}
type Building {
name
building.floors
}
<name>:string @index(exact) .
<building.floors>:[uid] @reverse .
<open>:bool .
Create data.rdf:
<0x1> <name> "Building1"^^<xs:string> .
<0x1> <dgraph.type> "Building"^^<xs:string> .
<0x1> <building.floors> <0x2> .
<0x1> <building.floors> <0x3> .
<0x2> <name> "1"^^<xs:string> .
<0x2> <open> "false"^^<xs:boolean> .
<0x2> <dgraph.type> "Floor"^^<xs:string> .
<0x2> <building.floors> <0x1> .
<0x3> <name> "2"^^<xs:string> .
<0x3> <open> "true"^^<xs:boolean> .
<0x3> <dgraph.type> "Floor"^^<xs:string> .
<0x3> <building.floors> <0x1> .
Remove one predicate:
curl -H "Content-Type: application/json" -X POST localhost:8080/mutate?commitNow=true -d $'{"delete":[{"uid":"0x3","open":null}]}'
Export as JSON:
curl http://localhost:8080/admin/export
Expected behaviour and actual result.
Actual result:
zcat export/dgraph.r*/g01.json.gz
[
{"uid":"0x1","name":"Building1"},
{"uid":"0x2","name":"1"},
{"uid":"0x3","name":"2"},
{"uid":"0x2","open":"false"},
,
{"uid":"0x1","dgraph.type":"Building"},
{"uid":"0x2","dgraph.type":"Floor"},
{"uid":"0x3","dgraph.type":"Floor"},
{"uid":"0x1","building.floors":[{"uid":"0x2"}]},
{"uid":"0x1","building.floors":[{"uid":"0x3"}]},
{"uid":"0x2","building.floors":[{"uid":"0x1"}]},
{"uid":"0x3","building.floors":[{"uid":"0x1"}]}
]
Expected:
[
{"uid":"0x1","name":"Building1"},
{"uid":"0x2","name":"1"},
{"uid":"0x3","name":"2"},
{"uid":"0x2","open":"false"},
{"uid":"0x1","dgraph.type":"Building"},
{"uid":"0x2","dgraph.type":"Floor"},
{"uid":"0x3","dgraph.type":"Floor"},
{"uid":"0x1","building.floors":[{"uid":"0x2"}]},
{"uid":"0x1","building.floors":[{"uid":"0x3"}]},
{"uid":"0x2","building.floors":[{"uid":"0x1"}]},
{"uid":"0x3","building.floors":[{"uid":"0x1"}]}
]
(with no empty line containing only a comma)
Currently exporting in JSON format generates invalid JSON files (when a predicate was deleted)
What version of Dgraph are you using?
1.2.1
Have you tried reproducing the issue with the latest release?
No
What is the hardware spec (RAM, OS)?
Not relevant
Steps to reproduce the issue (command/config used to run Dgraph).
Create 1.schema:
Create data.rdf:
Remove one predicate:
curl -H "Content-Type: application/json" -X POST localhost:8080/mutate?commitNow=true -d $'{"delete":[{"uid":"0x3","open":null}]}'Export as JSON:
curl http://localhost:8080/admin/exportExpected behaviour and actual result.
Actual result:
Expected:
(with no empty line containing only a comma)
Currently exporting in JSON format generates invalid JSON files (when a predicate was deleted)