English 中文(简体)
利用db.open与MongoDB和Nodejs
原标题:Using db.open with MongoDB and Nodejs
最佳回答

如果你需要知道某一 object子是否连接起来,你可以检查 d子_state=连接或db.serverConfig.isConnected()。

你可能更能实际地通过与贵方圆的已知相关物体,确保b在申请桌前打开。

问题回答

理由是,我已经建立了若干职能,与下刚果人沟通,但当某些职能相互互动时,即出现错误,使数据库可以多次打开。

You should reuse the db object instead of opening it multiple times - the same should be done with collection objects as there is a cost associated with creating them.

I m 采用javascript的驱动力,并直接在 d子旁使用开放式包裹的豆类财产。 援引它是一种简单的做法。

if (!db.openCalled) { //open database }




相关问题
Access DB Ref MongoDB

Whats the best way to access/query a DB Ref: UPDATE: users: name, groupref : {$ref:"groups",$id:"ObjectId ..." } } groups: name, topic, country,...,.. Assumption is that user belongs to only one ...

MongoDB nested sets

What re the best practices to store nested sets (like trees of comments) in MongoDB? I mean, every comment can have a parent comment and children-comments (answers). Storing them like this: { ...

MongoMapper and migrations

I m building a Rails application using MongoDB as the back-end and MongoMapper as the ORM tool. Suppose in version 1, I define the following model: class SomeModel include MongoMapper::Document ...

MongoDB takes long for indexing

I have the following setup: Mac Pro with 2 GB of RAM (yes, not that much) MongoDB 1.1.3 64-bit 8 million entries in a single collection index for one field (integer) wanted Calling .ensureIndex(...) ...

Storing and accessing large amounts of data

My application creates pieces of data that, in xml, would look like this: <resource url="someurl"> <term> <name>somename</name> <frequency>somenumber</...

热门标签