In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Because I am accustomed to using relational database, I feel that the flexibility of SQL statement to operate on data is needless to say and easy to understand and grasp, but after starting to use MongoDB, it is always awkward to operate on some data on the client command line, always prompting syntax errors. Although tools such as RockMongo or MongoVUE provide a lot of convenience, some operations still require command line operations. So make a general summary of the data manipulation commands on the command line:
1. View command prompts
Db.help ()
Db.collname.help ()
Db.collname.find () .help ()
Re.help ()
two。 Toggle creation of database
Use dbname
3. Query all databases
Show dbs
4. Delete the database currently in use
Db.dropDataBase ()
5. Create a collection (table)
Db.createCollection ("name", {size:1,capped:5,max:100})
6. Query
Db.table.find () is equivalent to: select * from table
Db.table.distinct ("name") is equivalent to: select distinct name from table
Db.table.find ({"age": 22}) is equivalent to: select * from table where age=22
Db.table.find ({"age": {$gte:22}}) is equivalent to select * from table where age > = 22
Db.table.find ({"age": {$lt:22}}) is equivalent to select * from table where age10 and age
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.