The installation and basic grammar of MongoDB learning

Source: Internet
Author: User
Tags create mongodb

Reference: http://www.cnblogs.com/lzrabbit/p/3682510.html

Reference: http://blog.csdn.net/qqiabc521/article/details/6325203


1) MongoDB installation as a Windows service

After downloading and extracting the website

Mongod--dbpath D:\MongoDB\data--installmongod--dbpath D:\MongoDB\data--logpath=d:\mongodb\logs\mongodb.log-- LOGAPPENDSC Create MongoDB binpath= "D:\MongoDB\bin\mongod.exe--service--dbpath D:\MongoDB\data--logpath=d:\mongodb \logs\mongodb.log--logappend "net start MongoDB

2) MongoDB Basic syntax

Switch database

Use test

Insert

Db.person.insert ({"Name": "Funky", "Age": 30})

Update

Db.collection.update (criteria, objnew, Upsert, Multi) db.person.update ({"Name": "Funky"},{"name": "Funky", "Age": 30}) Replace Db.person.update completely ({"name": "Funky"},{$set: {"Pass": "Mypass"}},false,true)//All updates, not inserted

Delete

Db.person.remove ({"Name": "Funky"})


The installation and basic grammar of MongoDB learning

Related Article

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.