Skip to content
New issue

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

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

Already on GitHub? # to your account

UpserId does not work for me #1

Open
gdiazlo opened this issue Jul 23, 2014 · 2 comments
Open

UpserId does not work for me #1

gdiazlo opened this issue Jul 23, 2014 · 2 comments

Comments

@gdiazlo
Copy link

gdiazlo commented Jul 23, 2014

Hello

The mongo storage uses this to save accesses, authorizations and clients:

UpsertId(data.Code, data)

But it does not work for me. (mongodb 2.4.9) It does not save data.Code as the id but an ObjectID generated by mongodb.

Does it work for you? what i'm missing with this?

thanks

@gdiazlo
Copy link
Author

gdiazlo commented Jul 23, 2014

Changin the UpserId part in SaveAccess with:

udata:= bson.M{"$set": data}
_, err := accesses.UpsertId(data.AccessToken, udata)

Works, but then, when recovering the data in LoadAccess, I get errors:

reflect.Set: value of type bson.M is not assignable to type osin.Client

@gdiazlo
Copy link
Author

gdiazlo commented Jul 23, 2014

Nevermind, I guess this is because I'm using the latest osin patch with the breaking changes...where Client is an interface.

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

No branches or pull requests

1 participant