osin-mongo-storage
osin-mongo-storage copied to clipboard
UpserId does not work for me
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
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
Nevermind, I guess this is because I'm using the latest osin patch with the breaking changes...where Client is an interface.