使用Java操作MongoDB - Basic Usage

List the basic usage, will introduce ‘CRUD’ in the following blogs:

1
2
3
4
5
6
7
8
9
10
11
12
13
Mongo mg = new Mongo("localhost", 27017);

// get db
db = mg.getDB("CRUD");

// get collection
dc = db.getCollection("test");

//remove collection
db.getCollection("test").drop();

//remove db
db.dropDatabase();
唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!