Common API usage Methods for Java operation mongoDB2.6

Source: Internet
Author: User
Tags bulk insert mongoclient win32

For MongoDB, there is not much difference between learning style and learning relational database

Start by learning how to insert, find, Update, remove, and then paging, sorting, indexing, and then the master-slave copy, copy sets, Shards and so on

The last is to practice the so-called advanced usage by the various drivers it provides, such as Java, PHP, node. js, and so on.


In addition: There are plsql developer,mysql with respect to Oracle Heidisql

MongoDB is no exception, it has a graphical tool called Mongovue, I use the 1.5.3 cracked version (not every 15 days will have to change the kind of register)


The following is a demonstration of Java as an example, the common operation of the MongoDB API use method

Package Com.jadyer.test;import Java.net.unknownhostexception;import Java.util.arraylist;import java.util.List; Import Org.bson.types.objectid;import org.junit.afterclass;import org.junit.beforeclass;import org.junit.Test; Import Com.mongodb.basicdbobject;import com.mongodb.db;import Com.mongodb.dbcollection;import com.mongodb.DBCursor ; Import Com.mongodb.dbobject;import Com.mongodb.mongoclient;import Com.mongodb.writeresult;import com.mongodb.util.json;/** * MongoDB Java Drive test * @see--------------------------------------------------------------- -------------------------* @see Configuration * @see 1) Download https://fastdl.mongodb.org/win32/mongodb-win32-x86_   64-2008plus-2.6.1.zip * @see 2) Unzip to the local hard drive D:\Develop\mongoDB\ and configure the environment variable Path=d:\develop\mongodb\bin * @see Then run this command under CMD to verify successful installation or not >mongod--version * @see 3) Create D:\Develop\mongoDBData\ directory for MongoDB data files * @see 4) Define your own bat file, The client that launches the MongoDB database and the connected database, respectively @see the Mongo_client.bat content of the startup client is-->mongo 127.0.0.1:27017/admin * @see start the database MONGO _db.bat content is------>mongod--dbpath D:\Develop\mongoDBData--rest * @see Note: add [--rest] to access the MONGODB Web console http://127.0.0.1:28017/* @ See----------------------------------------------------------------------------------------* @see java driver * @see The Java driver package for MongoDB is used here, http://docs.mongodb.org/ecosystem/drivers/java/* @see------------------------------------- ---------------------------------------------------* @create May, 10:17:30 PM * @author Xuan Yu 

Common API Usage for Java operations mongoDB2.6

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.