Discover mongodb distinct return all fields, include the articles, news, trends, analysis and practical advice about mongodb distinct return all fields on alibabacloud.com
0) MONGO: Connect MongoDB database via client1) Show DBS---Display the currently created database2) Use test---Create or switch databases3) Db.dropdatabase ()--Delete the current database3) Show Collections: Displays the collection created by the
Mongodb advanced 2: mongodb aggregation and mongodb advanced AggregationIn the previous article we talked about mongodb's advanced query: http://blog.csdn.net/stronglyh/article/details/46817789
This article introduces mongodb aggregation.
I. mongodb
Brief introduction
MongoDB is a NoSQL database based on distributed file storage
Written by the C + + language, stable and high performance
Designed to deliver scalable, high-performance data storage solutions for WEB applications
1. Count:--In an empty collection, Count returns a quantity of 0. > Db.test.count ()0--Test the return value of count after inserting a document.> Db.test.insert ({"Test": 1})> Db.test.count ()1> Db.test.insert ({"Test": 2})> Db.test.count
1. Count:
Copy Code code as follows:
--In an empty collection, Count returns a number of 0.
> Db.test.count ()
0
--Test the return value of count after inserting a document.
> Db.test.insert ({"Test": 1})
> Db.test.count ()
MongoDB database OverviewMongoDB is a high-performance, open-source, and non-pattern document-type database. It can be used in many scenarios to replace the traditional relational database or key/value storage mode. MongoDB is developed in C ++
MongoDB is written by C ++ and its name comes from HuMongoIn the middle of the word "us", we can see from the name that its ambition lies in the processing of massive data. The simplest description of this database is scalable, high-performance,
There is not a lot to know about MongoDB, but in this limited cognition, it is found that its nosql features are distinct.
Because the nosql of the relationship is very interesting and feels more comfortable than relational databases like MySQL.
So
Summary of MongoDB common commands
simple additions and deletions to check the dataSpecify the display in the query results or do not display a fieldFor example, we want to find all the data in the lessons collection, but we don't want to include
In the previous article we talked about MongoDB advanced query: http://blog.csdn.net/stronglyh/article/details/46817789This article is about MongoDB aggregation.A: MongoDB has a lot of aggregation framework, so that the transformation and
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.