MongoDB cập nhật mọi nơi

MongoDB cung cấp lệnh update() để cập nhật các tài liệu của một bộ sưu tập. Để chỉ cập nhật những tài liệu bạn muốn cập nhật, bạn có thể thêm tiêu chí vào câu lệnh cập nhật để chỉ những tài liệu được chọn mới được cập nhật

Các tham số cơ bản trong lệnh là điều kiện để tài liệu cần cập nhật, tiếp theo là sửa đổi cần thực hiện

Ví dụ sau đây cho thấy làm thế nào điều này có thể được thực hiện

Bước 1) Ra lệnh cập nhật

Bước 2) Chọn điều kiện mà bạn muốn sử dụng để quyết định tài liệu nào cần được cập nhật. Trong ví dụ của chúng tôi, chúng tôi muốn cập nhật tài liệu có ID nhân viên 22

Bước 3) Sử dụng lệnh set để sửa đổi Tên trường

Bước 4) Chọn Tên trường bạn muốn sửa đổi và nhập giá trị mới cho phù hợp

db.Employee.update(
{"Employeeid" : 1},
{$set: { "EmployeeName" : "NewMartin"}});

Nếu lệnh được thực hiện thành công, Kết quả sau sẽ được hiển thị

đầu ra

MongoDB cập nhật mọi nơi

Đầu ra hiển thị rõ ràng rằng một bản ghi phù hợp với điều kiện và do đó giá trị trường liên quan đã được sửa đổi

Sử dụng phương pháp

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
5 để cập nhật nhiều tài liệu phù hợp với tiêu chí lọc được chỉ định trong bộ sưu tập

cú pháp

db.collection.updateMany(filter, document, options)

Thông số

  1. lọc. Tiêu chí lựa chọn cho bản cập nhật, giống như phương thức find()
  2. tài liệu. Một tài liệu hoặc quy trình có chứa các sửa đổi để áp dụng
  3. tùy chọn. Không bắt buộc. Có thể chứa các tùy chọn cho hành vi cập nhật. Nó bao gồm upsert, writeConcern, đối chiếu, v.v.

Trong cú pháp trên,

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
6 trỏ đến cơ sở dữ liệu hiện tại,
db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
7 điểm là tên bộ sưu tập hiện có

Để minh họa thao tác cập nhật, hãy chèn các tài liệu mẫu sau vào bộ sưu tập

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
8

Dữ liệu mẫu

Sao chép

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])

Phần sau sửa đổi các tài liệu phù hợp bằng cách sử dụng phương pháp

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
2 trong bộ sưu tập
db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
8

Ví dụ. cập nhậtMany()

Sao chép

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 

đầu ra

{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}

Trong ví dụ trên, tham số đầu tiên là tiêu chí lọc được chỉ định dưới dạng tài liệu,

{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
1 chỉ ra rằng tìm tài liệu có
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
2 là
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
3. Tham số thứ hai được sử dụng để chỉ định các trường và giá trị sẽ được sửa đổi trên tài liệu phù hợp ở định dạng
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
4. Sử dụng để chỉ định một hành động để thực hiện. Ở đây chúng tôi muốn đặt giá trị của các trường, vì vậy hãy sử dụng toán tử
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
5 để chỉ định các trường và giá trị được cập nhật ở định dạng
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
6.
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
7 sửa đổi các trường
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
2 của tất cả các tài liệu phù hợp thành
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
9

Ở đầu ra,

db.employees.find() 
0 cho biết số lượng tài liệu phù hợp với tiêu chí và
db.employees.find() 
1 cho biết số lượng tài liệu được cập nhật

Bây giờ, hãy kiểm tra xem nó đã cập nhật một giá trị hay chưa bằng cách sử dụng phương pháp

db.employees.find() 
2 được hiển thị bên dưới

Kiểm tra tài liệu cập nhật

Sao chép

db.employees.find() 

đầu ra

[
  {
    _id: 1,
    firstName: 'John',
    lastName: 'King',
    email: '[email protected]',
    salary: 5000
  },
  {
    _id: 2,
    firstName: 'Sachin',
    lastName: 'T',
    email: '[email protected]',
    salary: 8000
  },
  {
    _id: 3,
    firstName: 'James',
    lastName: 'Bond',
    email: '[email protected]',
    salary: 7500
  },
  {
    _id: 4,
    firstName: 'Steve',
    lastName: 'J',
    email: '[email protected]',
    salary: 8500
  },
  {
    _id: 5,
    firstName: 'Kapil',
    lastName: 'D',
    email: '[email protected]',
    salary: 4500
  },
  {
    _id: 6,
    firstName: 'Amitabh',
    lastName: 'B',
    email: '[email protected]',
    salary: 8500
  }
]

Phương pháp

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
2 thêm trường được chỉ định nếu nó không tồn tại trong tài liệu phù hợp. Ví dụ: phần sau sẽ thêm trường
db.employees.find() 
4

Ví dụ. cập nhậtMany()

Sao chép

db.employees.updateMany({firstName:"Steve"}, { $set: {location: "USA"}}) 

đầu ra

{
  acknowledged: true,
  insertedId: null,
  matchedCount: 1,
  modifiedCount: 1,
  upsertedCount: 0
}

Thực hiện phương pháp

db.employees.find() 
2 sau đây để xem dữ liệu được cập nhật

Kiểm tra tài liệu cập nhật

Sao chép

db.employees.find({firstName:"Steve"}) 

đầu ra

{ 
    _id:4,
    firstName: "Steve",
    lastName: "J",
    email: "[email protected]",
    salary: 8500,
    location:"USA"
}

Nếu bạn chỉ định một tiêu chí lọc trống

db.employees.find() 
6, thì nó sẽ cập nhật tất cả các tài liệu. Sau đây sẽ cập nhật hoặc thêm trường
db.employees.find() 
4 trong tất cả các tài liệu

Ví dụ. cập nhậtMany()

Sao chép

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
0

đầu ra

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
1

Sử dụng toán tử cập nhật

db.employees.find() 
8 để tăng giá trị của trường theo số lượng đã chỉ định. Những điều sau đây tăng
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
2 lên
[
  {
    _id: 1,
    firstName: 'John',
    lastName: 'King',
    email: '[email protected]',
    salary: 5000
  },
  {
    _id: 2,
    firstName: 'Sachin',
    lastName: 'T',
    email: '[email protected]',
    salary: 8000
  },
  {
    _id: 3,
    firstName: 'James',
    lastName: 'Bond',
    email: '[email protected]',
    salary: 7500
  },
  {
    _id: 4,
    firstName: 'Steve',
    lastName: 'J',
    email: '[email protected]',
    salary: 8500
  },
  {
    _id: 5,
    firstName: 'Kapil',
    lastName: 'D',
    email: '[email protected]',
    salary: 4500
  },
  {
    _id: 6,
    firstName: 'Amitabh',
    lastName: 'B',
    email: '[email protected]',
    salary: 8500
  }
]
0 có mức lương là
{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}
9

Ví dụ. toán tử $inc

Sao chép

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
2

đầu ra

{
  acknowledged: true,
  insertedId: null,
  matchedCount: 2,
  modifiedCount: 2,
  upsertedCount: 0
}

Cập nhật nhiều trường

Bạn cũng có thể chỉ định nhiều trường để cập nhật. Các cập nhật sau các trường

[
  {
    _id: 1,
    firstName: 'John',
    lastName: 'King',
    email: '[email protected]',
    salary: 5000
  },
  {
    _id: 2,
    firstName: 'Sachin',
    lastName: 'T',
    email: '[email protected]',
    salary: 8000
  },
  {
    _id: 3,
    firstName: 'James',
    lastName: 'Bond',
    email: '[email protected]',
    salary: 7500
  },
  {
    _id: 4,
    firstName: 'Steve',
    lastName: 'J',
    email: '[email protected]',
    salary: 8500
  },
  {
    _id: 5,
    firstName: 'Kapil',
    lastName: 'D',
    email: '[email protected]',
    salary: 4500
  },
  {
    _id: 6,
    firstName: 'Amitabh',
    lastName: 'B',
    email: '[email protected]',
    salary: 8500
  }
]
2 và
[
  {
    _id: 1,
    firstName: 'John',
    lastName: 'King',
    email: '[email protected]',
    salary: 5000
  },
  {
    _id: 2,
    firstName: 'Sachin',
    lastName: 'T',
    email: '[email protected]',
    salary: 8000
  },
  {
    _id: 3,
    firstName: 'James',
    lastName: 'Bond',
    email: '[email protected]',
    salary: 7500
  },
  {
    _id: 4,
    firstName: 'Steve',
    lastName: 'J',
    email: '[email protected]',
    salary: 8500
  },
  {
    _id: 5,
    firstName: 'Kapil',
    lastName: 'D',
    email: '[email protected]',
    salary: 4500
  },
  {
    _id: 6,
    firstName: 'Amitabh',
    lastName: 'B',
    email: '[email protected]',
    salary: 8500
  }
]
3

Thí dụ. Cập nhật nhiều trường

Sao chép

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
4

đầu ra

{
  acknowledged: true,
  insertedId: null,
  matchedCount: 1,
  modifiedCount: 1,
  upsertedCount: 0
}

Thực hiện phương pháp

db.employees.find() 
2 sau đây để xem dữ liệu được cập nhật

Kiểm tra tài liệu cập nhật

Sao chép

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
6

đầu ra

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
7

Phương pháp

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
2 không cập nhật bất kỳ tài liệu nào nếu không tìm thấy tài liệu phù hợp. Ví dụ: phần sau sẽ không cập nhật bất kỳ tài liệu nào

Ví dụ. cập nhậtMany()

Sao chép

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
8

đầu ra

db.employees.insertMany([
    { 
        _id:1,
        firstName: "John",
        lastName: "King",
        email: "[email protected]",
        salary: 5000
    },
    { 
        _id:2,
        firstName: "Sachin",
        lastName: "T",
        email: "[email protected]",
        salary: 8000
    },
    { 
        _id:3,
        firstName: "James",
        lastName: "Bond",
        email: "[email protected]",
        salary: 7500
    },
    { 
        _id:4,
        firstName: "Steve",
        lastName: "J",
        email: "[email protected]",
        salary: 7000
    },
    { 
        _id:5,
        firstName: "Kapil",
        lastName: "D",
        email: "[email protected]",
        salary: 4500
    },
    { 
        _id:6,
        firstName: "Amitabh",
        lastName: "B",
        email: "[email protected]",
        salary: 7000
    }
])
9

Upsert - Thêm nếu không tồn tại

Chỉ định

[
  {
    _id: 1,
    firstName: 'John',
    lastName: 'King',
    email: '[email protected]',
    salary: 5000
  },
  {
    _id: 2,
    firstName: 'Sachin',
    lastName: 'T',
    email: '[email protected]',
    salary: 8000
  },
  {
    _id: 3,
    firstName: 'James',
    lastName: 'Bond',
    email: '[email protected]',
    salary: 7500
  },
  {
    _id: 4,
    firstName: 'Steve',
    lastName: 'J',
    email: '[email protected]',
    salary: 8500
  },
  {
    _id: 5,
    firstName: 'Kapil',
    lastName: 'D',
    email: '[email protected]',
    salary: 4500
  },
  {
    _id: 6,
    firstName: 'Amitabh',
    lastName: 'B',
    email: '[email protected]',
    salary: 8500
  }
]
6 làm tham số thứ ba trong phương thức
[
  {
    _id: 1,
    firstName: 'John',
    lastName: 'King',
    email: '[email protected]',
    salary: 5000
  },
  {
    _id: 2,
    firstName: 'Sachin',
    lastName: 'T',
    email: '[email protected]',
    salary: 8000
  },
  {
    _id: 3,
    firstName: 'James',
    lastName: 'Bond',
    email: '[email protected]',
    salary: 7500
  },
  {
    _id: 4,
    firstName: 'Steve',
    lastName: 'J',
    email: '[email protected]',
    salary: 8500
  },
  {
    _id: 5,
    firstName: 'Kapil',
    lastName: 'D',
    email: '[email protected]',
    salary: 4500
  },
  {
    _id: 6,
    firstName: 'Amitabh',
    lastName: 'B',
    email: '[email protected]',
    salary: 8500
  }
]
7.
[
  {
    _id: 1,
    firstName: 'John',
    lastName: 'King',
    email: '[email protected]',
    salary: 5000
  },
  {
    _id: 2,
    firstName: 'Sachin',
    lastName: 'T',
    email: '[email protected]',
    salary: 8000
  },
  {
    _id: 3,
    firstName: 'James',
    lastName: 'Bond',
    email: '[email protected]',
    salary: 7500
  },
  {
    _id: 4,
    firstName: 'Steve',
    lastName: 'J',
    email: '[email protected]',
    salary: 8500
  },
  {
    _id: 5,
    firstName: 'Kapil',
    lastName: 'D',
    email: '[email protected]',
    salary: 4500
  },
  {
    _id: 6,
    firstName: 'Amitabh',
    lastName: 'B',
    email: '[email protected]',
    salary: 8500
  }
]
8 thêm một tài liệu mới nếu không tìm thấy tài liệu phù hợp

Ví dụ. Upsert

Sao chép

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
0

đầu ra

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
1

Trong ví dụ trên, MongoDB thêm một tài liệu mới với _____24____9 mới, bởi vì nó không thể tìm thấy một tài liệu với ____27_______0

Cập nhật toán tử

Bảng sau đây liệt kê các toán tử cập nhật có thể được sử dụng với các phương thức

db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
4 và
db.employees.updateMany({ salary:7000 }, { $set: { salary:8500 }}) 
2

MethodDescription$currentDateĐặt giá trị của một trường thành ngày hiện tại, dưới dạng Ngày hoặc Dấu thời gian. $incTăng giá trị của trường theo số lượng đã chỉ định. $minChỉ cập nhật trường nếu giá trị đã chỉ định nhỏ hơn giá trị trường hiện có. $maxOnly cập nhật trường nếu giá trị được chỉ định lớn hơn giá trị trường hiện có. $mulNhân giá trị của trường với số lượng đã chỉ định. $renameĐổi tên trường. $setĐặt giá trị của một trường trong tài liệu. $setOnInsertĐặt giá trị của trường nếu một bản cập nhật dẫn đến việc chèn tài liệu. Không ảnh hưởng đến các hoạt động cập nhật sửa đổi các tài liệu hiện có. $unsetXóa trường đã chỉ định khỏi tài liệu

Làm cách nào để cập nhật hàng loạt bản ghi trong MongoDB?

Chúng ta có thể sử dụng phương thức initializeOrderedBulkOp() hoặc initializeUnorderedBulkOp() để thực hiện các thao tác hàng loạt trong MongoDB . Chúng tôi cần sử dụng số lượng lớn. exec() để chạy tất cả các hoạt động được xây dựng bởi các phương thức hàng loạt. Từ phiên bản MongoDB, 4. 2 phương pháp cập nhật hàng loạt sẽ chấp nhận tập hợp đường ống.

Làm cách nào để cập nhật tất cả các phần tử mảng trong MongoDB?

Tìm hiểu cách cập nhật các trường mảng trong tài liệu trong bộ sưu tập MongoDB. Bạn có thể sử dụng các phương thức updateOne() hoặc updateMany() để thêm, cập nhật hoặc xóa các phần tử mảng dựa trên các tiêu chí đã chỉ định . Nên sử dụng phương thức updateMany() để cập nhật nhiều mảng trong một bộ sưu tập.

Làm cách nào để cập nhật nhiều thứ trong MongoDB?

Phương thức updateMany() cập nhật tất cả tài liệu trong bộ sưu tập MongoDB khớp với truy vấn đã cho. .
Phương thức này có thể chấp nhận các tài liệu chỉ chứa các biểu thức toán tử cập nhật
Phương pháp này cũng có thể chấp nhận đường ống tổng hợp

Làm cách nào để cập nhật một trường trong MongoDB?

Cập nhật tài liệu cơ bản .
Bước 1) Ra lệnh cập nhật
Bước 2) Chọn điều kiện mà bạn muốn sử dụng để quyết định tài liệu nào cần được cập nhật. .
Bước 3) Sử dụng lệnh set để sửa đổi Tên trường
Bước 4) Chọn Tên trường bạn muốn sửa đổi và nhập giá trị mới cho phù hợp
đầu ra