From 3f5af44dd668b967a390bca583b615174471291a Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sat, 7 Jul 2018 13:48:11 +0200 Subject: [PATCH] Fixed error 'Unsupported document type for unmarshalling: []story.Chapter' in story.ListChapterStoryID --- model/story/chapter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/story/chapter.go b/model/story/chapter.go index cbc36ad..c8c0876 100644 --- a/model/story/chapter.go +++ b/model/story/chapter.go @@ -72,7 +72,7 @@ func FindChapterID(id string) (Chapter, error) { // ListChapterStoryID lists all chapters for the story ID func ListChapterStoryID(storyID string) ([]Chapter, error) { chapters := make([]Chapter, 0, 8) - err := chapterCollection.Find(bson.M{"storyId": storyID}).Sort("createdDate").One(&chapters) + err := chapterCollection.Find(bson.M{"storyId": storyID}).Sort("createdDate").All(&chapters) if err != nil { return nil, err }