Skip to content

illegal document key when supplied with empty _key #145

Closed
@MrDHat

Description

@MrDHat

I am facing an issue wherein whenever I try to save a struct, it says illegal document key. Here is what the struct looks like:

type User struct {
    Email     string    `json:"email"`
    Name      string    `json:"name"`
    Password  string    `json:"password"`
    DBKey     string    `json:"_key,omitmepty"`
    DBID      string    `json:"_id,omitmepty"`
    DBRev     string    `json:"_rev,omitmepty"`
    CreatedAt time.Time `json:"createdAt"`
    UpdatedAt time.Time `json:"updatedAt"`
    DeletedAt time.Time `json:"deletedAt"`
}

I am guessing it is because _key comes as an empty string when I pass along an object of this struct. I do not want to generate the keys at my end and want to rely on arango for the same.
Is there a workaround to this?

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