013 exercise file updated tủ tài liệu training

1 32 0
013 exercise file updated tủ tài liệu training

Đang tải... (xem toàn văn)

Thông tin tài liệu

1) Creating First Database //below is the syntax for creating database Here database name is m ​ yblogs use myblogs; // creating first ​collection ​in the database m ​ yblogs​ Here, ​collection ​name is “​articles​” db.articles.insert({name : “mongoDB intro”, category :“database”, tags : [“nosql”,”db”,”bigdata”]}); // querying a collection db.articles.find().pretty(); // creating a ​document ​and saving to collection var ​articleInfo ​={}; articleInfo​.articleName= “MongoDB Introduction”; articleInfo​.authorName =”Sunil G”; articleInfo​.tags = [“database”,“NoSQL”,”DBA”,“DEV”]; // saving a document to collection db.​articles​.save(​articleInfo​); P.S: in the above example, Database Name: ​myblogs Collection Name:​articles Document Name: ​articleInfo

Ngày đăng: 17/11/2019, 07:36

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan