Skip to content

correct way to get multiple documents ? #70

Closed
@stefanwuthrich

Description

@stefanwuthrich

I try to do something like this:

`
query := "FOR d IN scenario RETURN d"
cursor, err := storage.ArangoDb.Query(storage.Ctx, query, nil)

if err != nil {
	fmt.Println(err)
}

var scenarios []Scenario
_, err = cursor.ReadDocument(storage.Ctx, &scenarios)

`

which of course gives following error:
cannot unmarshal object into Go value of type []model.Scenario
as cursor.ReadDocument get's only 1 document.

What is the correct way to get full array?

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