我有一个工作的网络应用程序与MongoDB数据库。我的应用程序正在将信息获取/发布到运行在本地主机上的数据库上。
const db = monk('localhost/datbaseName') //create/connect to database 'databaseName'
const posts = db.get('posts') //created a collection named 'posts' in 'databaseName'
我最近在mongoDB Atlas上建立了一个数据库mon
我从mongodb文件中读到:
important:
db.fsyncLock() may block reads, including those necessary to verify authentication
warning:
When calling db.fsyncLock(), ensure that the connection is kept open to allow a subsequent call to db.fsyncUnlock(). Closing the connection may make it difficult to release the lock