dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

Running mutation with storage type changes results

Open ashwin95r opened this issue 10 years ago • 1 comments

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.

ashwin95r avatar Nov 30 '16 04:11 ashwin95r

07f9f721c3e79cebe7a86efa1a7e725aae332bf3 fixes this.

ashwin95r avatar Nov 30 '16 06:11 ashwin95r