mongodb terminal commands

Want to know mongodb terminal commands? we have a huge selection of mongodb terminal commands information on alibabacloud.com

MongoDB Common Basic Management commands

outDb.killop (Opid)Create a Collection1, create a collection that is 100 000 bytesDb.createcollection ("mycollection", {capped:true,size:100000})2, create a collection with a size of 100000 bytes and a maximum document count of 100Db.createcollection ("mycollection", {capped:true,size:100000max:100})Force buffer data to be flushed to diskDb.runcommand ({"Fsync": 1, "Lock": 1})Online Backup and Recoverymongodump-d Database-o Backupdirmongorestore-d Database--drop BackupdirMONGO MasterMasterMongo

MongoDB Common Commands

}, "OK":1}>db.posts.stats () {"OK":0,"errmsg":"Collection [nutch.posts] not found." }> Delete the currently used database: >db.dropdatabase (); View the database currently in use: >db.getname (); >db; The DB and GetName methods are the same effect and can query the currently used database Current DB version: Db.version (); Error message before query: Db.getpreverror (); Clear Error Logging: Db.reseterror (); User-related1. Add a userDb.addus

MongoDB Common Operations Commands

space size db.userInfo.dataSize ();4. Get the DB Db.userInfo.getDB () where the current aggregation set resides;5, get the current gathering state db.userInfo.stats ();6, get the aggregate aggregate size db.userInfo.totalSize ();7, aggregate storage space size db.userInfo.storageSize ();8. Shard Version Information Db.userInfo.getShardVersion ()9, Aggregation set rename Db.userInfo.renameCollection ("Users"); Rename UserInfo to users10. Delete the current aggregation set Db.userInfo.drop ();[SQ

2. MongoDB Common Commands

collection 1, create a clustered collection (table) db.createcollection ("Collname", {size:20, capped:5, Max: 100}); 2, the Aggregation set (table) db.getcollection ("account") that gets the specified name, 3, gets all the aggregation sets of the current DB db.getcollectionnames (); 4, Displays the status of all clustered indexes in the current DB db.printcollectionstats (); user-related 1, adding a user db.adduser ("name"); Db.adduser ("UserName", "pwd123", true); Add users, set passwords, rea

MongoDB basic Commands

The following format is MongoDB command | MySQL command, the latter as a referenceView DatabaseShow DBS | show databases;View Current Databasedb | Select Database ();Create a databaseUse Test1 | Create DATABASE Test1Note that it is not possible to show DBS in this time. An empty database needs to add at least one file Db.movie.insert ({"Test": "Test"})Switch databaseUse Test1 | Use Test1Deleting a databaseEnter Database Db.dropdatabase | Drop Database

Some commands in MongoDB

Tags: color cat port Store field conf Information Tor DMI Query based on the length of a field (title) in the collectionDb.collections. Find true " This.title.length " })// Note that kanji is not a character Refresh the config information for the MONGOs cacheDb.admincommand ({"flushrouterconfig":1})// Refresh the cache after modifying configuration in config Using pipelines to import a database from one instance node to another instance20001 passwd 20002 passwd -D dstdbname--archive S

MongoDB Common Commands

program2. Database-related commands:Db.test.find ({id:10}) returns the DataSet Db.test.find ({id:10}) of the test dataset id=10. Count () returns the total number of data id=10 for the test dataset Db.test.find ({id:10}). l Imit (2) returns the dataset of the test dataset id=10 from the second data set Db.test.find ({id:10}). Skip (8) returns the DataSet id=10 the test dataset Db.test.find from 0 to eighth ({ID :). Limit (2). Skip (8) Returns the data set for the test dataset id=1= from the sec

Total Pages: 11 1 .... 7 8 9 10 11 Go to: Go

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.