- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What does createdCollectionAutomatically mean in MongoDB?
If a collection does not exist then MongoDB creates a collection in indexing part. The createdCollectionAutomatically tells that the operation created a collection.
For our example, let us create a collection with an index −
> db.createCollectionDemo.createIndex({"ClientCountryName":1});
This will produce the following output −
{ "createdCollectionAutomatically" : true, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 }
Let us create a collection with documents −
> db.createCollectionDemo.insertOne({"ClientName":"Larry","ClientCountryName":"US"}); { "acknowledged" : true, "insertedId" : ObjectId("5cd2950be3526dbddbbfb612") }
Following is the query to display all documents from a collection with the help of find() method −
> db.createCollectionDemo.find().pretty();
This will produce the following output −
{ "_id" : ObjectId("5cd2950be3526dbddbbfb612"), "ClientName" : "Larry", "ClientCountryName" : "US" }
- Related Articles
- What does the max field mean in the output of MongoDB db..stats( )?
- What does humus mean?
- What does psychology mean?
- What does geometry mean?
- What does # mean in Lua programming?
- What does operator ~= mean in Lua?
- What does series mean in pandas?
- What does "return@" mean in Kotlin?
- What does “javascript:void(0)” mean?
- What does these operators mean (** , ^ , %, //) ?
- What Does Defensive Security Mean?
- What Does Offensive Security Mean?
- What does Waning Gibbous mean?
- What does INT(7) in MySQL mean?
- Strange syntax, what does `?.` mean in JavaScript?

Advertisements