doppelganger113 / doppelganger113/example-go-tui

Problem with id generation in mongodb

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

https://github.com/doppelganger113/example-go-tui/blob/236f8d7dc91573b78cf61cd1b5ad3de0a53d59a0/internal/storage/user_repository.go#L13

Love your blog post, found it very helpful yet i run into this problem where it leads to id duplicates in mongo. Nothing really related to tui itself, but maybe helpful for someone who wants to strictly follow the post.
Following a simple solution.

`type User struct {
Id primitive.ObjectID `bson:"_id,omitempty"`
Email string
}`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.