Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assigning a 1n relation #21

Open
fabulousduck opened this issue Apr 24, 2018 · 0 comments
Open

Assigning a 1n relation #21

fabulousduck opened this issue Apr 24, 2018 · 0 comments

Comments

@fabulousduck
Copy link

currently i have a model that is as the following

	ConfirmedGuests      []interface{} `model:"Guest" relation:"1n" autosave:"true"`

In the flow that I have in my backend, I get the data for the guests and the data for the model that ConfirmedGuests lives in. I first create all guests and put their bson.ObjectId's in a slice. then I wish to assign them to ConfirmedGuests. But since ConfirmedGuests is of type []interface{} and my guests slice is of type []bson.ObjectId I cannot assign them when creating the struct ConfirmedGuests lives in. Is there any way of assigning this through a clever cast or something ?

Regards, Duck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant