import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.MongoClient;

import java.net.UnknownHostException;

/**
 * @author zhangzhengyi
 */
public class Yihuijiushan extends BasePipeline {
    public static void main(String[] args) throws UnknownHostException {
        MongoClient client = new MongoClient("IP", 27017);
        DB capture = client.getDB("");
        DBCollection changcheng = capture.getCollection("");
        DBCursor dbCursor = changcheng.find();
        while (dbCursor.hasNext()) {
            System.out.println(dbCursor.next());
        }
    }
}
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐