expand cannot return all predicate for me as below. And it should return all predicate like user_name and register_time not only ‘user_id’ predicate as below.
schame as below:
type Chapter {
chapter_id: Int!
chapter_title: String! @search(by: [term, fulltext])
belong_course: Course
}
type Course {
course_id: Int!
course_name: String! @search(by: [term, fulltext])
}
type Browser{
browser_times: Int!
browser_chapter: [Chapter]
}
type User {
user_id: Int!
user_name: String @search(by: [hash])
register_time: DateTime
browser: [Browser]
}
data was imported by dgraph live -f data1.json
as below:
[root@kg ~]# head -2 data1.json
{"user_id":3,"user_name":"ZmoscJ","register_time":"2020-06-08 20:24:03","browser":[{"browser_times":6,"browser_chapter":{"chapter_id":5,"chapter_title":"在你心里,...?","belong_course":{"course_id":5,"course_name":"金融...50讲"}}},{"browser_times":6,"browser_chapter":{"chapter_id":17,"chapter_title":"社交....吗?","belong_course":{"course_id":17,"course_name":"y...讲堂"}}},{"browser_times":2,"browser_chapter":{"chapter_id":8,"chapter_title":"“幸福”","belong_course":{"course_id":8,"course_name":"测试"}}}]}
{"user_id":4,"user_name":"🍃☁⚡💦☔","register_time":"2020-06-08 20:25:06","browser":[{"browser_times":1,"browser_chapter":{"chapter_id":2,"chapter_title":"测试财...","belong_course":{"course_id":2,"course_name":"给...课"}}},{"browser_times":1,"browser_chapter":{"chapter_id":18,"chapter_title":"测试...课","belong_course":{"course_id":18,"course_name":" J...四讲"}}},{"browser_times":2,"browser_chapter":{"chapter_id":1,"chapter_title":"测试...","belong_course":{"course_id":1,"course_name":"给...课"}}},{"browser_times":7,"browser_chapter":{"chapter_id":17,"chapter_title":"社交....吗?","belong_course":{"course_id":17,"course_name":"t讲堂"}}},{"browser_times":1,"browser_chapter":{"chapter_id":16,"chapter_title":"社交...吗?","belong_course":{"course_id":16,"course_name":"基于...设施"}}},{"browser_times":1,"browser_chapter":{"chapter_id":14,"chapter_title":"微信","belong_course":{"course_id":14,"course_name":"经济...的"}}},{"browser_times":1,"browser_chapter":{"chapter_id":6,"chapter_title":"“报....吗","belong_course":{"course_id":6,"course_name":"“报...行”"}}},{"browser_times":8,"browser_chapter":{"chapter_id":5,"chapter_title":"在你...吗?","belong_course":{"course_id":5,"course_name":"金融...50讲"}}},{"browser_times":1,"browser_chapter":{"chapter_id":4,"chapter_title":"“报复...吗","belong_course":{"course_id":4,"course_name":"“报...行”"}}},{"browser_times":1,"browser_chapter":{"chapter_id":3,"chapter_title":"第...课","belong_course":{"course_id":3,"course_name":"金融...课"}}}]}