dgraph
dgraph copied to clipboard
Running mutation with storage type changes results
I'm using the schema_scalar file in cmd/dgraph as the schema file.
Try these commands:
$ curl localhost:8080/query -XPOST -d $'mutation{
set {
<a> <loc> "{\'type\':\'Point\', \'Coordinates\':[1, 3]}"^^<geo:geojson> .
<b> <loc> "{\'type\':\'Point\', \'Coordinates\':[1, 2]}"^^<geo:geojson> .
<b> <name> "b" .
<a> <name> "a" . }}'
$ curl localhost:8080/query -XPOST -d $'{ me(intersects("loc", "{\'Type\':\'Point\' , \'Coordinates\':[1,3]}")) {name}}'
This should return the name "a"
Now clear the p/ and w/ and do:
$ curl localhost:8080/query -XPOST -d $'mutation{
set {
<a> <loc> "{\'type\':\'Point\', \'Coordinates\':[1, 3]}" .
<b> <loc> "{\'type\':\'Point\', \'Coordinates\':[1, 2]}" .
<b> <name> "b" .
<a> <name> "a" . }}'
$ curl localhost:8080/query -XPOST -d $'{ me(intersects("loc", "{\'Type\':\'Point\' , \'Coordinates\':[1,3]}")) {name}}'
This will return an empty result which is incorrect.
07f9f721c3e79cebe7a86efa1a7e725aae332bf3 fixes this.