MongoDB Node.JS Driver 1.4.9 documentation
来源:互联网 发布:双轨直销软件xajczxwl 编辑:程序博客网 时间:2024/05/17 05:07
db.open(function(err, db) {
摘自
- MongoDB Node.JS Driver 1.4.9 documentation
open
Initialize the database connection.
- open(callback)
Arguments: - callback (function) – this will be called after executing this method. The first parameter will contain the Error object if an error occurred, or null otherwise. While the second parameter will contain the index information or null if an error occurred.
Returns: null
Examples
An example of a simple single server db connection
var Db = require('mongodb').Db, MongoClient = require('mongodb').MongoClient, Server = require('mongodb').Server, ReplSetServers = require('mongodb').ReplSetServers, ObjectID = require('mongodb').ObjectID, Binary = require('mongodb').Binary, GridStore = require('mongodb').GridStore, Grid = require('mongodb').Grid, Code = require('mongodb').Code, BSON = require('mongodb').pure().BSON, assert = require('assert');var db = new Db('test', new Server('localhost', 27017));// Establish connection to dbdb.open(function(err, db) { assert.equal(null, err); db.on('close', test.done.bind(test)); db.close();});
0 0
- MongoDB Node.JS Driver 1.4.9 documentation
- MONGODB NODE.JS DRIVER
- MongoDB Native Node.js Driver
- CentOS 6.5下安装node.js mongodb(express driver)
- Node.js v7.4.0 Documentation Addons
- node.js结合mongodb
- Node.js + MongoDB
- node.js使用mongodb
- node.js结合mongodb
- Node.JS + MongoDB技术讲座
- node.js mongodb ReplSet
- Node.js搭配Mongodb
- node.js 操作 mongodb
- Node.js + MongoDB学习
- node.js连接mongodb
- mongodb+node.js入门
- Node.js使用MongoDB
- node.js操作mongodb
- centos7yum安装mesos(1.0.0)+marathon+zookeeper+docker
- C++ 类与对象
- Javascript 链式操作以及流程控制
- SYs_BIOS swi中断
- java正则表达式 match 和 find
- MongoDB Node.JS Driver 1.4.9 documentation
- 执行 hadoop checknative 报错 openssl: false Cannot load libcrypto.so
- Linux网络设置-方法
- ahk脚本简介
- Taglib(tld)的原理和实现(实例)
- MyBatis org.apache.ibatis.exceptions.PersistenceException NoSuchMethodException
- Android避免内存溢出(Out of Memory)方法总结
- [leetcode-二叉树先序遍历]--144.Binary Tree Preorder Traversal
- MongoDB副本集搭建