Skip to content

Cannot display list type data using expand function #4497

@zhuyaoyhj

Description

@zhuyaoyhj

What version of Dgraph are you using?

Dgraph version   : v1.1.1
Dgraph SHA-256   : 20a10e9db316b565464e0a04cea09657eebbaea3b91460ab651997ada63243cc
Commit SHA-1     : 8994a5740
Commit timestamp : 2019-12-16 18:24:50 -0800
Branch           : HEAD
Go version       : go1.13.5

Have you tried reproducing the issue with the latest release?

yes

What is the hardware spec (RAM, OS)?

GNU/Linux, RAM:36G

Steps to reproduce the issue (command/config used to run Dgraph).

1、data:

schema:
    languages: [string] . 
    type test {
        languages
    }
data:
    _:a <languages> "广东" (lang="zh") .
    _:a <languages> "四川" (lang="zh") .
    _:a <languages> "东北" (lang="zh") .
    _:a <languages> "普通" (lang="zh") .
    _:a <languages> "英语" (lang="en") .
    _:a <languages> "日语" (lang="jo") .
    _:a <dgraph.type> "test" .

2、use expand function to query , no languages data show.

{
    q(func:uid(2)){
        <dgraph.type>
            expand(_all_)
    }
}
or
{
    q(func:uid(2)){
        <dgraph.type>
            expand(test)
    }
}

result:

{
"data": {
"q": [
  {
    "dgraph.type": [
      "test"
    ]
  }
]
},
"extensions": {
"server_latency": {
  "parsing_ns": 326299,
  "processing_ns": 2020930,
  "encoding_ns": 197910,
  "assign_timestamp_ns": 2406986,
  "total_ns": 5633799
},
"txn": {
  "start_ts": 26
},
"metrics": {
  "num_uids": {
    "": 1,
    "dgraph.type": 1,
    "languages": 1
  }
}
}
}

3、query predicate

{
    q(func:uid(2)){
    <languages>
    <dgraph.type>
    }
}

result
{
"data": {
"q": [
  {
    "languages": [
      "广东",
      "普通",
      "东北",
      "英语",
      "四川",
      "日语"
    ],
    "dgraph.type": [
      "test"
    ]
  }
]
},
"extensions": {
"server_latency": {
  "parsing_ns": 326156,
  "processing_ns": 1671640,
  "encoding_ns": 119304,
  "assign_timestamp_ns": 3313287,
  "total_ns": 6979007
},
"txn": {
  "start_ts": 27
},
"metrics": {
  "num_uids": {
    "": 1,
    "dgraph.type": 1,
    "languages": 1
  }
}
}
}

Expected behaviour and actual result.

use expand(all) or expand(type) can query step 3 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions