I don't know how to phrase this better, so here's an example:
considering
type Message struct {
Date types.NullTime `json:"date" db:"date"`
Id string `json:"id" db:"id"`
From string `json:"from" db:"from"`
CommentId string `json:"commentId" db:"commentId"`
}
message := Message{}
err := DB.Get(&message, `
MATCH (m:Message {commentId: {0}})
RETURN m.date AS date,
m.id AS id,
m.from as from, m.commentId as commentId`,
commentId)
This works. message is populated according to the Message definitions.
message := Message{}
err := DB.Get(&message, `
MATCH (m:Message {commentId: {0}})
RETURN m`,
commentId)
This doesn't work.
Now that I wrote, I can imagine why this happens and that it isn't an bug, but perhaps there is a way to make this kind of query easier. Neo4j should have a RETURN m.* statement, but it doesn't.
I don't know how to phrase this better, so here's an example:
considering
This works.
messageis populated according to theMessagedefinitions.This doesn't work.
Now that I wrote, I can imagine why this happens and that it isn't an bug, but perhaps there is a way to make this kind of query easier. Neo4j should have a
RETURN m.*statement, but it doesn't.