MongoDB Studio 3T Practice Set Using Tweets.json Dataset | Realcode4you
Install MongoDB and Studio 3T on your computer, create a new database with a name and import 'Tweets.json' (available on iLearn) as a collection. Then complete the following exercises.

Exercise
1. Insert 2 new Tweets to the collection.
2. Write a MongoDB query that returns all the Tweets.
3. Write a MongoDB query to find one of your Tweets with user’s name: "user 30".
4. Update two Tweets to have two tags called “My first tag” and “My second tag” respectively. Show two ways to do this. Do the first one using update() and do the second one using save(). Hint: for save(), you might want to query the object, store it in a variable first; then update it and save the update.
5. Write a MongoDB query to retrieve all documents from the Tweets collection where user name equals either "user 30" or "user 40".
6. Write a MongoDB query to retrieve all documents from the Tweets collection where user screen_name is "Twitter User" and user location is "Internet". (Specify AND Conditions)
7. Write a MongoDB query to retrieve all documents from the Tweets collection where user screen_name is "Twitter User" or user url is "user URL". (Specify OR Conditions)
8. Write a MongoDB query to retrieve all documents from the Tweets collection where user id is not 224499494502
Solution
1. Insert 2 new Tweets to the collection.
A 1.
Solution 1:
//Tweet 1
db.tweets.insert(
{
"created_at": "Thu Apr 06 15:24:15 +0000 2020",
"id_str": "1850006245121695744",
"text": "Have a nice day",
"user": {
"id": NumberLong(2244456599494501),
"name": "user 01",
"screen_name": "Twitter User",
"location": "Internet",
"url": "user URL",
"description": "user description"
},
"place": {
},
"entities": {
"hashtags": [
],
"urls": [{
"url": "twt url sample",
"unwound": {
"url": "url sample",
"title": "web page title"
}
}],
"user_mentions": [
]
}
})//Tweet 2
db.tweets.insert(
{
"created_at": "Thu Apr 06 15:24:15 +0000 2020",
"id_str": "1850006245121695744",
"text": "Good Morning",
"user": {
"id": NumberLong(2244456599494501),
"name": "user 01",
"screen_name": "Twitter User",
"location": "Internet",
"url": "user URL",
"description": "user description"
},
"place": {
},
"entities": {
"hashtags": [
],
"urls": [{
"url": "twt url sample",
"unwound": {
"url": "url sample",
"title": "web page title"
}
}],
"user_mentions": [
]
}
})Solution 2:
db.tweets.insert(
[{
"created_at": "Thu Apr 06 15:24:15 +0000 2020",
"id_str": "1850006245121695744",
"text": "Hi",
"user": {
"id": 2244456599494501,
"name": "user 01",
"screen_name": "Twitter User",
"location": "Internet",
"url": "user URL",
"description": "user description"
},
"place": {
},
"entities": {
"hashtags": [
],
"urls": [{
"url": "twt url sample",
"unwound": {
"url": "url sample",
"title": "web page title"
}
}],
"user_mentions": [
]
}
},
{
"created_at": "Thu Apr 06 15:24:17 +0000 2020",
"id_str": "8510006245121695744",
"text": "Welcome",
"user": {
"id": 224499494503,
"name": "user 03",
"screen_name": "Twitter User",
"location": "Internet",
"url": "user URL",
"description": "user description"
},
"place": {
},
"entities": {
"hashtags": [
],
"urls": [{
"url": "twt url sample",
"unwound": {
"url": "url sample",
"title": "web page title"
}
}],
"user_mentions": [
]
}
}
]
)
2. Write a MongoDB query that returns all the Tweets.
db.Tweets.find() 3. Write a MongoDB query to find one of your Tweets with user’s name: "user 30".
db.Tweets.findOne({"user.name":"user 30"})4. Update two Tweets to have two tags called “My first tag” and “My second tag” respectively. Show two ways to do this. Do the first one using update() and do the second one using save(). Hint: for save(), you might want to query the object, store it in a variable first; then update it and save the update.
Solution 1 (update ()):
db.Tweets.update({"user.name":"user 30"}, {$set:{"tag":"My first tag"}})
db.Tweets.update({"user.name":"user 40"}, {$set:{"tag":"My second tag"}}) Solution 2 (save ()):
var tweet_user30 = db.Tweets.findOne({"user.name":"user 30"})
tweet_user30["tag"] = "My first tag"
db.Tweets.save(tweet_user30)
var tweet_user40 = db.Tweets.findOne({"user.name":"user 40"})
tweet_user40["tag"] = "My second tag"
db.Tweets.save(tweet_user40)5. Write a MongoDB query to retrieve all documents from the Tweets collection where user name equals either "user 30" or "user 40".
db.Tweets.find({"user.name":{ $in: [ "user 30", "user 40" ] } })6. Write a MongoDB query to retrieve all documents from the Tweets collection where user screen_name is "Twitter User" and user location is "Internet". (Specify AND Conditions)
db.Tweets.find({$and: [{"user.screen_name": "Twitter User"}, {"user.location":"Internet"}]})7. Write a MongoDB query to retrieve all documents from the Tweets collection where user screen_name is "Twitter User" or user url is "user URL". (Specify OR Conditions)
db.Tweets.find({ $or: [{"user.screen_name": "Twitter User"}, {"user.url":"user URL"}]})8. Write a MongoDB query to retrieve all documents from the Tweets collection where user id is not 224499494502.
Solution 1:
db.Tweets.find({"user.id":{$ne:224499494502}})Solution 2:
db.Tweets.find({"user.id":{$not:{$eq:224499494502}}})


Khi tìm hiểu một nền tảng trực tuyến mới, điều tạo ấn tượng đầu tiên thường không phải là số lượng tính năng mà chính là cách mọi thông tin được sắp xếp. Một giao diện rõ ràng, dễ quan sát có thể giúp người mới nhanh chóng làm quen và tìm được khu vực mình quan tâm. Trong quá trình tìm hiểu Hay 88, điểm đáng chú ý là cách bố trí nội dung khá gọn gàng và trực quan.
789bet Có lần đang tìm thông tin trên mạng thì thấy tên trang này nên mở vào xem thử cho biết. Mình chỉ lướt giao diện chứ chưa đọc kỹ từng phần, chủ yếu xem cách họ dẫn người dùng qua các mục. Trang làm khá gọn, menu không quá nhiều lựa chọn, nội dung cũng được gom theo từng khu vực nên nhìn khá dễ hiểu. Phần thông tin về giấy phép pháp lý được đặt tương đối rõ ràng, ai muốn kiểm tra có thể nhận ra ngay. Xem một lúc thấy bố cục thoáng, các tiêu đề có điểm nhấn và tổng thể không tạo cảm giác bị quá tải
8kbet trang này mình tình cờ lướt qua khi đang tra cứu một số tài liệu trực tuyến. Mình chủ yếu để ý đến thiết kế, hệ thống danh mục cùng cách bài trí thông tin trên website. Nhìn chung giao diện khá gọn gàng, các phần được tách bạch rõ ràng giúp việc quan sát rất thuận tiện. Lướt qua một lượt xong mình lại quay về với nội dung đang tìm kiếm dở dang.
Trong môi trường trực tuyến, bảo mật thông tin luôn là vấn đề đáng chú ý. Khi tìm hiểu SHBET, người dùng nên chủ động kiểm tra các chính sách liên quan đến tài khoản, thông tin cá nhân, giao dịch và quyền riêng tư. Một thói quen tốt là sử dụng mật khẩu riêng biệt, không chia sẻ thông tin đăng nhập cho người khác và tránh truy cập tài khoản từ các thiết bị không đáng tin cậy. Những biện pháp này giúp người dùng chủ động hơn khi sử dụng SHBET cũng như các dịch vụ trực tuyến khác.
Hôm trước mình lướt thử thì thấy từ khóa Socolive Full HD được nhắc nhiều, nên mình tò mò vào xem giao diện là chính. Vừa mở lên thấy họ để tiêu đề “cổng game chính thức 2026” khá to nên cũng yên tâm là đúng trang, nhìn phát nhận ra ngay. Trang chia nội dung theo từng khối nên kéo xuống không bị ngợp, đọc trên điện thoại cũng ổn, chữ không quá nhỏ. Nói chung cảm giác bố cục được làm gọn gàng, nhất là cách họ làm các khối nội dung và tiêu đề nổi bật trên trang.