Thursday, January 3, 2019

Short Note of Query

1. Create Collection

======> use db_name

Note - db_name == collection name

2. Show All Database

======> show dbs

3. Show particular db data

======> db.db_name.find()

4. Insert Data in DB

======> db.db_name.insert({"Name":"XYZ"})

5. Show All Collection

======> Show Collections

6. Create Collection

======> db.createcollections("XYZ")

7. Drop collection XYZ

======>db.XYZ.drop()

8. Drop collection "XYZ Test", if contain white space in collection name

======> db.["XYZ Test"].drop()

No comments:

Post a Comment