sử dụng deleteOne() kèm theo selector query, sẽ tìm kiếm xóa cái đầu tiền, deleteMany?() sẽ tìm tât cả selector query phù hợp và xóa db.users.drop() drop collection db.dropDatabas() drop database
Day: April 15, 2021
Section 8: Update Operations
Ta sử dụng 2 hàm là updateOne() cho việc update riêng 1 document và updateMany() là update theo nhiều documents. Cập nhật 1 thông tin user hobbies: Sau khi updateOne: Với updateMany, tìm kiếm các hobbies title là Sports, sau đó set isSporty: true Updating Multiple Fields with“$set” . Incrementing & DecrementingValues Tăng thêm tuổi […]