One of the problem I had with the native driver over and over was that you
should keep the db instance somewhere, but it is returned asynchronous from
the connect method. So, you have to make sure that you call connect only
once and you keep that instance somewhere. I didn't like this API so using
async.memoize I wrote mongo-getdb:

https://github.com/jfromaniello/mongo-getdb

with this wrapper you can call getDb as many times as you want and you will
always get the same unique instance of db.

This is something I didn't like about the native driver, just to keep in
mind.




2013/12/30 Jason.桂林(Gui Lin) <[email protected]>

>     node-mongodb-native is the most popular node mongodb driver. But it is
> not easy to use. I think a mongodb driver should exports the db instance
> and collection instance synchronized or promised. So I wrote mongoskin, a
> wrapper layer of node-mongodb-native.
>
>     But I personally don't like mongoskin. Why wrap node-mongdb-native,
> why not write a new mongodb driver?
>
>     I think node_redis API is good, just return the redisClient instance
> but not callback, so I can inject the redisClient instance into my service
> object, and initial my service.
>
>     The bson library is OK,  so the protocol of mongodb can be handled.
>
>     Anyone have interesting to write one?
>
>
>
>
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to