Closed
Description
Hi,
I am using dgraph 1.0.9
I run a query to get objects, and use order by for sorting the results,
If I order by an optional fields, there is unconsistent behavior:
for 'text' fields - all objects return , the objects w/o that fields return at the end of the list
for 'int' or 'date' fields, - the list return when the objects w/o that field are filtered!
example:
Prepare the data:
`{
set{
_:bookA <title> "A smart dog" .
_:bookA <isBook> "true" .
_:bookA <price> "3" .
_:bookB <title> "Beat the bill" .
_:bookB <isBook> "true" .
_:bookC <price> "5" .
_:bookC <isBook> "true" .
}
}`
Query for all books, order by title ->
`{
Query(func: has(isBook), orderasc: title )
{
count(uid)
title
price
}
}`
Result - all boos are return:
`"data": {
"Query": [
{
"count": 3
},
{
"title": "A smart dog",
"price": 3,
"uid": "0x26"
},
{
"title": "Beat the bill",
"uid": "0x27"
},
{
"price": 5,
"uid": "0x28"
}
]
}`
Query for all books, order by price->
`{
Query(func: has(isBook), orderasc: price )
{
count(uid)
title
price
}
}'
Result - Query without price are filtered!!!
`{
"data": {
"Query": [
{
"count": 2
},
{
"title": "A smart dog",
"price": 3,
"uid": "0x26"
},
{
"price": 5,
"uid": "0x28"
}
]
}`
Metadata
Metadata
Assignees
Labels
No labels