nswbmw / koa-mongo

MongoDB middleware for koa, support connection pool.
145 stars 31 forks source link

ObjectId function not included #21

Closed barbunzel closed 7 years ago

barbunzel commented 7 years ago

I've been playing around with koa (v1) and koa-mongo (v0.6.0) for a few hours and I tried to implement an endpoint to retrieve a document with a specific _id; however, I can't seem to find any documentation on mongo.ObjectId and if it's included in koa-mongo. Since it seems it isn't included, I've added it to the module myself by adding it to this.mongo - although I'm not sure if I could achieve it in a different way. What's the correct approach for this?

If this is useful for someone else, I can create a pull request for this.

Thanks!

nswbmw commented 7 years ago

pr welcome :)

barbunzel commented 7 years ago

Reviewed your commit, and it is still missing for 0.x.

nswbmw commented 7 years ago

@dieguito151 https://github.com/nswbmw/koa-mongo/commit/31b2f7685bb61cdb736e18ed11cbc91accd69b48

barbunzel commented 7 years ago

@nswbmw awesome! thanks!