Closed cgossain closed 3 years ago
Hi,
This looks really good, thank you. Would it be possible to add tests and a README, similar to the other store packages?
Alex
Hey Alex, absolutely. I’ll take a look at that a little later.
Christian
Hey @alexedwards, I added tests and a README.
All tests passed successfully on my machine. I tested using mongodb-community.
Please have a look and let me know if there are any other changes needed.
Thanks,
Christian
@alexedwards Hey Alex, just a friendly reminder I've added the tests and README as requested. Let me know if there's anything else missing for the merge.
Christian
@cgossain Sorry, I hadn't forgotten, I'm just very pushed for time at the moment.
I've had a quick look and have run into the following things:
go.mod
and go.sum
files int the mongodbstore
directory. You should be able to run the following commands to add these:$ cd mongodbstore
$ go mod init github.com/alexedwards/scs/mongodbstore
$ go mod tidy
The import path in the README example will then need to change from "github.com/alexedwards/scs/v2/mongodbstore"
to "github.com/alexedwards/scs/mongodbstore"
(note no v2
).
The errors returned by mongo.Connect()
should be handled in all the test functions.
In mongodbstore.go
line 143 would result in duplicate log messages being written (it duplicates line 113).
If you can send another commit addressing those things, then I'll test it out again :+1:
@alexedwards great catches!
I've pushed some additional commits addressing your points above.
Thanks for reviewing.
Thanks very much! I'll try to get this merged in the next couple of days.
I've just merged this now, thanks again for your time and effort to get it completed :+1:
Uses the official MongoDB driver for Go. https://github.com/mongodb/mongo-go-driver
I used the other stores as a reference.