Hướng dẫn how do i export and import mongodb database? - làm cách nào để xuất và nhập cơ sở dữ liệu mongodb?

Tài liệu về nhà → la bàn MongoDBMongoDB Compass

Show

Bạn có thể sử dụng Compass MongoDB để nhập và xuất dữ liệu đến và từ các bộ sưu tập. La bàn hỗ trợ nhập và xuất cho cả tệp JSON và CSV. Để nhập hoặc xuất dữ liệu sang hoặc từ bộ sưu tập, điều hướng đến chế độ xem bộ sưu tập chi tiết bằng cách chọn bộ sưu tập từ tab Cơ sở dữ liệu hoặc nhấp vào bộ sưu tập trong điều hướng bên trái.JSON and CSV files. To import or export data to or from a collection, navigate to the detailed collection view by either selecting the collection from the Databases tab or clicking the collection in the left-side navigation.

MongoDB Compass có thể nhập dữ liệu vào một bộ sưu tập từ tệp JSON hoặc CSV.JSON or CSV file.

  • Nhập dữ liệu vào một bộ sưu tập không được phép trong phiên bản dễ đọc của La bàn.MongoDB Compass Readonly Edition.

  • Nhập dữ liệu không có sẵn nếu bạn được kết nối với hồ dữ liệu.Data Lake.

Trước khi bạn có thể nhập dữ liệu của mình vào La bàn MongoDB, trước tiên bạn phải đảm bảo rằng nó được định dạng chính xác.

Để nhập dữ liệu được định dạng của bạn vào một bộ sưu tập:

Bạn có thể chọn bộ sưu tập từ tab Bộ sưu tập hoặc nhấp vào bộ sưu tập trong khung bên trái.

Hướng dẫn how do i export and import mongodb database? - làm cách nào để xuất và nhập cơ sở dữ liệu mongodb?

La bàn hiển thị hộp thoại sau:

Hướng dẫn how do i export and import mongodb database? - làm cách nào để xuất và nhập cơ sở dữ liệu mongodb?

Trong chọn Loại tệp đầu vào, chọn JSON hoặc CSV.Select Input File Type, select either JSON or CSV.

Nếu bạn đang nhập tệp CSV, bạn có thể chỉ định các trường để nhập và các loại của các trường đó trong chỉ định các trường và loại. Kiểu dữ liệu mặc định cho tất cả các trường là chuỗi.Specify Fields and Types. The default data type for all fields is string.

Hướng dẫn how do i export and import mongodb database? - làm cách nào để xuất và nhập cơ sở dữ liệu mongodb?

Để loại trừ một trường khỏi tệp CSV bạn đang nhập, bỏ chọn hộp kiểm bên cạnh tên trường đó. Để chọn một loại cho một trường, hãy sử dụng menu thả xuống bên dưới tên trường đó.

Trong các tùy chọn, định cấu hình các tùy chọn nhập cho trường hợp sử dụng của bạn.Options, configure the import options for your use case.

Nếu bạn đang nhập tệp CSV, bạn có thể chọn cách phân đoạn dữ liệu của bạn.

Đối với cả nhập tệp JSON và CSV, bạn có thể chuyển đổi bỏ qua các chuỗi trống và dừng lỗi:Ignore empty strings and Stop on errors:

  • Nếu được kiểm tra, hãy bỏ qua các chuỗi trống sẽ giảm các trường với các giá trị chuỗi trống từ các tài liệu đã nhập của bạn. Tài liệu vẫn được nhập với tất cả các trường khác.Ignore empty strings drops fields with empty string values from your imported documents. The document is still imported with all other fields.

  • Nếu được kiểm tra, hãy dừng các lỗi sẽ ngăn bất kỳ dữ liệu nào được nhập trong trường hợp lỗi. Nếu không được kiểm soát, dữ liệu được chèn cho đến khi gặp lỗi và việc chèn thành công không được quay lại. Hoạt động nhập sẽ không tiếp tục sau khi gặp lỗi trong cả hai trường hợp.Stop on errors prevents any data from being imported in the event of an error. If unchecked, data is inserted until an error is encountered and successful inserts are not rolled back. The import operation will not continue after encountering an error in either case.

Một thanh tiến trình hiển thị trạng thái của nhập. Nếu xảy ra lỗi trong quá trình nhập, thanh tiến trình chuyển sang màu đỏ và thông báo lỗi xuất hiện trong hộp thoại. Sau khi nhập thành công, hộp thoại đóng và la bàn hiển thị trang thu thập chứa các tài liệu mới được nhập.

MongoDB Compass có thể xuất dữ liệu từ một bộ sưu tập dưới dạng tệp JSON hoặc CSV. Nếu bạn chỉ định một bộ lọc hoặc đường ống tổng hợp cho bộ sưu tập của bạn, la bàn chỉ xuất các tài liệu phù hợp với kết quả truy vấn hoặc đường ống được chỉ định.JSON or CSV file. If you specify a filter or aggregation pipeline for your collection, Compass only exports documents which match the specified query or pipeline results.

Mặc dù có thể loại trừ các tài liệu bằng cách sử dụng bộ lọc truy vấn, nhưng không thể định hình lại các tài liệu đã xuất với tài liệu dự án. Ngay cả khi bạn chỉ định tùy chọn

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

4 trong truy vấn, la bàn vẫn xuất toàn bộ tài liệu.

Để nhập và xuất dữ liệu từ dòng lệnh, bạn có thể sử dụng các công cụ cơ sở dữ liệu của MongoDB. Xem Mongoimport và MongoExport.Database Tools. See mongoimport and mongoexport.

Tài liệu về nhà → Công cụ cơ sở dữ liệu MongoDBMongoDB Database Tools

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 là một công cụ dòng lệnh tạo ra xuất khẩu dữ liệu JSON hoặc CSV được lưu trữ trong một ví dụ MongoDB. is a command-line tool that produces a JSON or CSV export of data stored in a MongoDB instance.

Chạy

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 từ dòng lệnh hệ thống, không phải shell

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

7.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
from the system command line, not the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

7
shell.

Mẹo

Xem thêm:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

8 cung cấp khả năng nhập dữ liệu có cấu trúc tương ứng.

Ghi chú

Nếu bạn đang lưu trữ dữ liệu cũ để tiết kiệm chi phí lưu trữ, hãy xem xét lưu trữ trực tuyến trong Atlas MongoDB. Lưu trữ trực tuyến tự động lưu trữ dữ liệu được truy cập không thường xuyên đến các thùng S3 được quản lý đầy đủ để phân loại dữ liệu hiệu quả về chi phí.Online Archive in MongoDB Atlas. Online Archive automatically archives infrequently accessed data to fully-managed S3 buckets for cost-effective data tiering.

Bắt đầu với MongoDB 4.4,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 hiện được phát hành tách biệt với máy chủ MongoDB và sử dụng phiên bản riêng của nó, với phiên bản ban đầu là

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

0. Trước đây,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 đã được phát hành cùng với máy chủ MongoDB và sử dụng phiên bản phù hợp.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
is now released separately from the MongoDB Server and uses its own versioning, with an initial version of

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

0. Previously,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
was released alongside the MongoDB Server and used matching versioning.

Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5, tham chiếu tài liệu máy chủ MongoDB cho phiên bản đó của công cụ:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
, reference the MongoDB Server Documentation for that version of the tool:

Ghi chú

Nếu bạn đang lưu trữ dữ liệu cũ để tiết kiệm chi phí lưu trữ, hãy xem xét lưu trữ trực tuyến trong Atlas MongoDB. Lưu trữ trực tuyến tự động lưu trữ dữ liệu được truy cập không thường xuyên đến các thùng S3 được quản lý đầy đủ để phân loại dữ liệu hiệu quả về chi phí.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5.

Bắt đầu với MongoDB 4.4,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 hiện được phát hành tách biệt với máy chủ MongoDB và sử dụng phiên bản riêng của nó, với phiên bản ban đầu là

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

0. Trước đây,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 đã được phát hành cùng với máy chủ MongoDB và sử dụng phiên bản phù hợp. version

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 supports the following versions of the MongoDB Server:

  • Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5, tham chiếu tài liệu máy chủ MongoDB cho phiên bản đó của công cụ:

  • Tài liệu này dành cho phiên bản

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    3 của

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5.

  • mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 Phiên bản

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    3 hỗ trợ các phiên bản sau của máy chủ MongoDB:

  • MongoDB 6.0

MongoDB 5.0

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 may work on earlier versions of MongoDB server, any such compatibility is not guaranteed.

MongoDB 4.4 version

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 is supported on the following platforms:

x86_64

ARM64

PPC64LE

s390x

MongoDB 4.2

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau: / CentOS 8

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau: / CentOS 7

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau: / CentOS 6

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

Mặc dù

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 có thể hoạt động trên các phiên bản trước của máy chủ MongoDB, nhưng bất kỳ khả năng tương thích nào như vậy không được đảm bảo.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 được hỗ trợ trên các nền tảng sau:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
tool is part of the MongoDB Database Tools package:

Amazon 2

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 command has the following form:

mongoexport --collection=

Chạy

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 từ dòng lệnh hệ thống, không phải shell

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

7.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
from the system command line, not the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

7
shell.

Mẹo

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com" --collection=events --db=reporting --out=events.json [additional options]

5 to export. If you do not specify an

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com" --collection=events --db=reporting --out=events.json [additional options]

6
,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
writes to the standard output (e.g. stdout).

Xem thêm:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

8 cung cấp khả năng nhập dữ liệu có cấu trúc tương ứng.

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com" --collection=events --db=reporting --out=events.json [additional options]

5
to the specified

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com" --collection=events --db=reporting --out=events.json [additional options]

6
from a local MongoDB instance running on port 27017:

mongoexport --collection=events --db=reporting --out=events.json

Ghi chú

  • Nếu bạn đang lưu trữ dữ liệu cũ để tiết kiệm chi phí lưu trữ, hãy xem xét lưu trữ trực tuyến trong Atlas MongoDB. Lưu trữ trực tuyến tự động lưu trữ dữ liệu được truy cập không thường xuyên đến các thùng S3 được quản lý đầy đủ để phân loại dữ liệu hiệu quả về chi phí.

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    Bắt đầu với MongoDB 4.4,

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 hiện được phát hành tách biệt với máy chủ MongoDB và sử dụng phiên bản riêng của nó, với phiên bản ban đầu là

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    0. Trước đây,

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 đã được phát hành cùng với máy chủ MongoDB và sử dụng phiên bản phù hợp.

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0
    , the database can be specified as part of the string.

  • Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5, tham chiếu tài liệu máy chủ MongoDB cho phiên bản đó của công cụ:

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    2

    mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

  • Tài liệu này dành cho phiên bản

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    3 của

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5.

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    2
    and

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    4

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 hỗ trợ các phiên bản sau của máy chủ MongoDB:Options.

MongoDB 6.0

  • MongoDB 5.0

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    Bắt đầu với MongoDB 4.4,

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 hiện được phát hành tách biệt với máy chủ MongoDB và sử dụng phiên bản riêng của nó, với phiên bản ban đầu là

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    0. Trước đây,

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 đã được phát hành cùng với máy chủ MongoDB và sử dụng phiên bản phù hợp.

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0
    , the database can be specified as part of the string.

  • Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5, tham chiếu tài liệu máy chủ MongoDB cho phiên bản đó của công cụ:

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    2

    mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com" --collection=events --db=reporting --out=events.json [additional options]

Tài liệu này dành cho phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

3 của

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
reads from the primary of the replica set. To override the default, you can specify the read preference:

  • mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 Phiên bản

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    3 hỗ trợ các phiên bản sau của máy chủ MongoDB:

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    MongoDB 6.0

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    0 option:

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    Bắt đầu với MongoDB 4.4,

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 hiện được phát hành tách biệt với máy chủ MongoDB và sử dụng phiên bản riêng của nó, với phiên bản ban đầu là

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]

    0. Trước đây,

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 đã được phát hành cùng với máy chủ MongoDB và sử dụng phiên bản phù hợp.

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0
    , the database can be specified as part of the string.

  • Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5, tham chiếu tài liệu máy chủ MongoDB cho phiên bản đó của công cụ:

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    2
    command-line option. The command-line option takes a string if specifying only the read preference mode:

    mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

    Hoặc, tùy chọn dòng lệnh có thể có một tài liệu được bao gồm

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    3 để chỉ định chế độ, các bộ thẻ ưu tiên đọc tùy chọn và các bộ thẻ MaxStalessionSeconds tùy chọn:read preference tag sets, and the optional maxStalenessSeconds:

    mongoexport --collection=events --db=reporting --out=events.json

    0

Để biết thêm thông tin về các tùy chọn có sẵn, xem Tùy chọn.Options.

Để kết nối với cụm Sharded để xuất dữ liệu của nó, bạn cũng có thể:

  • Chỉ định tên máy chủ của phiên bản

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    4 trong

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    4
    instance in the

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0

    mongoexport --collection=events --db=reporting --out=events.json

    1

    Khi sử dụng

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0, cơ sở dữ liệu có thể được chỉ định là một phần của chuỗi.

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0
    , the database can be specified as part of the string.

  • Chỉ định tên máy chủ và cổng của phiên bản

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    4 trong

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    2

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    4
    instance in the

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    2

    mongoexport --collection=events --db=reporting --out=events.json

    2

Theo mặc định,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 đọc từ chính của bộ bản sao Shard. Để ghi đè mặc định, bạn có thể chỉ định ưu tiên đọc:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
reads from the primary of the shard replica set. To override the default, you can specify the read preference:

  • Bạn có thể chỉ định ưu tiên đọc trong

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0

    mongoexport --collection=events --db=reporting --out=events.json

    3

    Nếu chỉ định các thẻ ưu tiên đọc, bao gồm tùy chọn

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    0:

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    0
    option:

    mongoexport --collection=events --db=reporting --out=events.json

    4

    Khi sử dụng

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0, cơ sở dữ liệu có thể được chỉ định là một phần của chuỗi.

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    0
    , the database can be specified as part of the string.

  • Chỉ định tên máy chủ và cổng của phiên bản

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    4 trong

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    2

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    2
    command-line option. The command-line option takes a string if specifying only the read preference mode:

    mongoexport --collection=events --db=reporting --out=events.json

    5

    Hoặc, tùy chọn dòng lệnh có thể có một tài liệu được bao gồm

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    3 để chỉ định chế độ, các bộ thẻ ưu tiên đọc tùy chọn và các bộ thẻ MaxStalessionSeconds tùy chọn:read preference tag sets, and the optional maxStalenessSeconds:

    mongoexport --collection=events --db=reporting --out=events.json

    6

Để biết thêm thông tin về các tùy chọn có sẵn, xem Tùy chọn.Options.

Để kết nối với cụm Sharded để xuất dữ liệu của nó, bạn cũng có thể:

Chỉ định tên máy chủ của phiên bản mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]4 trong mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]0

Khi sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

0, cơ sở dữ liệu có thể được chỉ định là một phần của chuỗi. requires read access on the target database.

Chỉ định tên máy chủ và cổng của phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4 trong

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

2

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

6
role on the target database.

Theo mặc định,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 đọc từ chính của bộ bản sao Shard. Để ghi đè mặc định, bạn có thể chỉ định ưu tiên đọc:

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7
or

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4
that enforces Authentication, ensure you use the required security parameters based on the configured authentication mechanism.

Bạn có thể chỉ định ưu tiên đọc trong

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

0BSON data types when using

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
to perform full instance backups, be sure to specify Extended JSON v2.0 (Canonical mode) to the

mongoexport --collection=events --db=reporting --out=events.json

00
option to

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
, in the following fashion:

mongoexport --collection=events --db=reporting --out=events.json

7

Nếu chỉ định các thẻ ưu tiên đọc, bao gồm tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

0:

mongoexport --collection=events --db=reporting --out=events.json

00
is unspecified,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
outputs data in Extended JSON v2.0 (Relaxed mode) by default.

Bạn có thể chỉ định ưu tiên đọc bằng tùy chọn dòng lệnh

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2. Tùy chọn dòng lệnh có một chuỗi nếu chỉ chỉ định chế độ ưu tiên đọc:JSON format found in the specified target data file when restoring. For example, it will use Extended JSON v2.0 (Canonical mode) if the target data export file was created by

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
with

mongoexport --collection=events --db=reporting --out=events.json

06 specified.

Mẹo automatically creates FIPS-compliant connections to a

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4
that is configured to use FIPS mode.

Xem thêm:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 uses read preference

mongoexport --collection=events --db=reporting --out=events.json

11
. To override the default, you can specify the read preference in the

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2
command line option or in the

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

0

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 yêu cầu truy cập đọc trên cơ sở dữ liệu đích.

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2
, the

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2
value overrides the read preference specified in the URI string.

Đảm bảo rằng người dùng kết nối sở hữu, ở mức tối thiểu, vai trò mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]6 trên cơ sở dữ liệu đích.

Khi kết nối với mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]7 hoặc mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]4 thực thi xác thực, hãy đảm bảo bạn sử dụng các tham số bảo mật cần thiết dựa trên cơ chế xác thực được cấu hình.

Nếu bạn cần lưu giữ tất cả các loại dữ liệu BSON phong phú khi sử dụng

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 để thực hiện sao lưu phiên bản đầy đủ, hãy chắc chắn chỉ định JSON v2.0 (chế độ chính tắc) cho tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

00 thành

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5, theo kiểu sau:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
should not be used with field names that make use of these characters.

Nếu

mongoexport --collection=events --db=reporting --out=events.json

00 không được xác định,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Dữ liệu xuất ra trong JSON v2.0 (chế độ thư giãn) theo mặc định) theo mặc định. cannot differentiate between type wrappers and fields that happen to have the same name as type wrappers. Do not use Extended JSON formats in contexts where the corresponding BSON representations might include (

mongoexport --collection=events --db=reporting --out=events.json

16) prefixed keys. The DBRef mechanism is an exception to this general rule.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

8 sẽ tự động sử dụng định dạng JSON được tìm thấy trong tệp dữ liệu đích được chỉ định khi khôi phục. Ví dụ: nó sẽ sử dụng JSON v2.0 mở rộng (chế độ chính tắc) nếu tệp xuất dữ liệu đích được tạo bởi

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 với

mongoexport --collection=events --db=reporting --out=events.json

06 được chỉ định.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
with (

mongoexport --collection=events --db=reporting --out=events.json

17) in field names. Since CSV files use the (

mongoexport --collection=events --db=reporting --out=events.json

17) to represent data hierarchies, a (

mongoexport --collection=events --db=reporting --out=events.json

17) in a field name will be misinterpreted as a level of nesting.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Tự động tạo các kết nối tuân thủ FIP thành

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4 được cấu hình để sử dụng chế độ FIP.

Returns information on the options and use of

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5

Theo mặc định,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 sử dụng tùy chọn đọc

mongoexport --collection=events --db=reporting --out=events.json

11. Để ghi đè mặc định, bạn có thể chỉ định ưu tiên đọc trong tùy chọn dòng lệnh

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2 hoặc trong

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

0

Increases the amount of internal reporting returned on standard output or in log files. Increase the verbosity with the

mongoexport --collection=events --db=reporting --out=events.json

29 form by including the option multiple times, (e.g.

mongoexport --collection=events --db=reporting --out=events.json

30.)

Nếu bạn chỉ định đọc ưu tiên trong chuỗi URI và

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2, giá trị

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2 sẽ ghi đè lên sở thích đọc được chỉ định trong chuỗi URI.

Runs

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 in a quiet mode that attempts to limit the amount of output.

Cảnh báo

  • Nhập dữ liệu và xuất xung đột với ($) và (.)database commands

  • Bắt đầu từ MongoDB 5.0, tên trường tài liệu có thể là (

    mongoexport --collection=events --db=reporting --out=events.json

    16) có tiền tố và có thể chứa một (

    mongoexport --collection=events --db=reporting --out=events.json

    17). Tuy nhiên,

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    8 và

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 không nên được sử dụng với các tên trường sử dụng các ký tự này.

  • MongoDB mở rộng JSON V2 không thể phân biệt giữa các gói gói và trường xảy ra có cùng tên với trình bao bọc loại. Không sử dụng các định dạng JSON mở rộng trong các bối cảnh trong đó các biểu diễn BSON tương ứng có thể bao gồm (

    mongoexport --collection=events --db=reporting --out=events.json

    16) các khóa có tiền tố. Cơ chế DBREF là một ngoại lệ cho quy tắc chung này.

  • Cũng có những hạn chế đối với việc sử dụng

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    8 và

    mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

    5 với (

    mongoexport --collection=events --db=reporting --out=events.json

    17) trong tên trường. Vì các tệp CSV sử dụng (

    mongoexport --collection=events --db=reporting --out=events.json

    17) để biểu thị phân cấp dữ liệu, A (

    mongoexport --collection=events --db=reporting --out=events.json

    17) trong tên trường sẽ bị hiểu sai như một mức độ làm tổ.

mongoexport --collection=events --db=reporting --out=events.json

26Returns thông tin về các tùy chọn và sử dụng

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5

Returns the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 release number.

mongoexport --collection=events --db=reporting --out=events.json

28 tăng số lượng báo cáo nội bộ được trả lại cho đầu ra tiêu chuẩn hoặc trong các tệp nhật ký. Tăng độ merbosity với biểu mẫu

mongoexport --collection=events --db=reporting --out=events.json

29 bằng cách bao gồm tùy chọn nhiều lần, (ví dụ:

mongoexport --collection=events --db=reporting --out=events.json

30.)

New in version 100.3.0.

mongoexport --collection=events --db=reporting --out=events.json

31Run

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 trong chế độ yên tĩnh cố gắng hạn chế lượng đầu ra.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
:

  • mongoexport --collection=events --db=reporting --out=events.json

    37

  • mongoexport --collection=events --db=reporting --out=events.json

    38

  • mongoexport --collection=events --db=reporting --out=events.json

    39

Tùy chọn này triệt tiêu:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5, aside from specifying it through a password prompt.

đầu ra từ các lệnh cơ sở dữ liệu

mongoexport --collection=events --db=reporting --out=events.json

8

Hoạt động sao chép

Hãy chắc chắn để bảo mật tệp này với quyền hệ thống tập tin phù hợp.

Ghi chú

mongoexport --collection=events --db=reporting --out=events.json

43 Chỉ định chuỗi kết nối URI có thể giải quyết được của triển khai MongoDB, được đặt trong các trích dẫn:

Specifies the resolvable URI connection string of the MongoDB deployment, enclosed in quotes:

mongoexport --collection=events --db=reporting --out=events.json

9

Bắt đầu với phiên bản

mongoexport --collection=events --db=reporting --out=events.json

44 của

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5, chuỗi kết nối có thể được cung cấp thay thế dưới dạng tham số vị trí mà không cần sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

38:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
, the connection string may alternatively be provided as a positional parameter, without using the

mongoexport --collection=events --db=reporting --out=events.json

38
option:

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

0

Là một tham số vị trí, chuỗi kết nối có thể được chỉ định tại bất kỳ điểm nào trên dòng lệnh, miễn là nó bắt đầu với

mongoexport --collection=events --db=reporting --out=events.json

47 hoặc

mongoexport --collection=events --db=reporting --out=events.json

48. Ví dụ:

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

1

Chỉ có thể cung cấp một chuỗi kết nối. Cố gắng bao gồm nhiều hơn một, cho dù sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

38 hoặc làm đối số vị trí, sẽ dẫn đến lỗi.

mongoexport --collection=events --db=reporting --out=events.json

38
option or as a positional argument, will result in an error.

Để biết thông tin về các thành phần của chuỗi kết nối, hãy xem tài liệu định dạng URI chuỗi kết nối.Connection String URI Format documentation.

Ghi chú

mongoexport --collection=events --db=reporting --out=events.json

43 Chỉ định chuỗi kết nối URI có thể giải quyết được của triển khai MongoDB, được đặt trong các trích dẫn:

mongoexport --collection=events --db=reporting --out=events.json

50
may alternatively be specified using their own explicit command-line options, such as

mongoexport --collection=events --db=reporting --out=events.json

51
and

mongoexport --collection=events --db=reporting --out=events.json

37
. Providing a connection string while also using an explicit option and specifying conflicting information will result in an error.

Ghi chú

mongoexport --collection=events --db=reporting --out=events.json43 Chỉ định chuỗi kết nối URI có thể giải quyết được của triển khai MongoDB, được đặt trong các trích dẫn:

Bắt đầu với phiên bản

mongoexport --collection=events --db=reporting --out=events.json

44 của

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5, chuỗi kết nối có thể được cung cấp thay thế dưới dạng tham số vị trí mà không cần sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

38:

mongoexport --collection=events --db=reporting --out=events.json

38
option may be visible to system status programs such as

mongoexport --collection=events --db=reporting --out=events.json

54 that may be invoked by other users. Consider instead:

  • Là một tham số vị trí, chuỗi kết nối có thể được chỉ định tại bất kỳ điểm nào trên dòng lệnh, miễn là nó bắt đầu với

    mongoexport --collection=events --db=reporting --out=events.json

    47 hoặc

    mongoexport --collection=events --db=reporting --out=events.json

    48. Ví dụ:

  • Chỉ có thể cung cấp một chuỗi kết nối. Cố gắng bao gồm nhiều hơn một, cho dù sử dụng tùy chọn

    mongoexport --collection=events --db=reporting --out=events.json

    38 hoặc làm đối số vị trí, sẽ dẫn đến lỗi.

    mongoexport --collection=events --db=reporting --out=events.json

    55
    option to specify a configuration file containing the password.

Để biết thông tin về các thành phần của chuỗi kết nối, hãy xem tài liệu định dạng URI chuỗi kết nối.

Default: localhost:27017

Một số thành phần trong

mongoexport --collection=events --db=reporting --out=events.json

50 có thể được chỉ định bằng cách sử dụng các tùy chọn dòng lệnh rõ ràng của riêng họ, chẳng hạn như

mongoexport --collection=events --db=reporting --out=events.json

51 và

mongoexport --collection=events --db=reporting --out=events.json

37. Cung cấp một chuỗi kết nối đồng thời sử dụng tùy chọn rõ ràng và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
attempts to connect to a MongoDB instance running on the localhost on port number

mongoexport --collection=events --db=reporting --out=events.json

58.

Cảnh báo

mongoexport --collection=events --db=reporting --out=events.json

59 and a seed list of set members, as in the following:

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

2

Trên một số hệ thống, mật khẩu được cung cấp trong chuỗi kết nối với tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

38 có thể hiển thị cho các chương trình trạng thái hệ thống như

mongoexport --collection=events --db=reporting --out=events.json

54 có thể được gọi bởi những người dùng khác. Thay vào đó hãy xem xét:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
always connects to the primary.

bỏ qua mật khẩu trong chuỗi kết nối để nhận lời nhắc mật khẩu tương tác hoặc

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

3

Sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

55 để chỉ định tệp cấu hình chứa mật khẩu.

mongoexport --collection=events --db=reporting --out=events.json

56Default: Localhost: 27017

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

2
and specifying conflicting information will result in an error.

Chỉ định tên máy chủ có thể giải quyết được của triển khai MongoDB. Theo mặc định,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 cố gắng kết nối với một thể hiện MongoDB đang chạy trên localhost trên số cổng

mongoexport --collection=events --db=reporting --out=events.json

58.

Default: 27017

Để kết nối với một bộ bản sao, chỉ định

mongoexport --collection=events --db=reporting --out=events.json

59 và danh sách hạt giống của các thành viên đã đặt, như sau:

Khi chỉ định định dạng danh sách SET bản sao,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 luôn kết nối với chính.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

4
and specifying conflicting information will result in an error.

Bạn cũng có thể kết nối với bất kỳ thành viên nào của bản sao được đặt bằng cách chỉ định máy chủ và cổng chỉ của thành viên đó:

Enables connection to a

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7 or

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4
that has TLS/SSL support enabled.

Nếu bạn sử dụng IPv6 và sử dụng định dạng

mongoexport --collection=events --db=reporting --out=events.json

61, bạn phải gửi lại phần của địa chỉ và kết hợp cổng trong ngoặc (ví dụ:

mongoexport --collection=events --db=reporting --out=events.json

62).

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --collection=events --db=reporting --out=events.json

68
and specifying conflicting information will result in an error.

Ngoài ra, bạn cũng có thể chỉ định tên máy chủ trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

2 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients.

mongoexport --collection=events --db=reporting --out=events.json

65Default: 27017

Specifies the

mongoexport --collection=events --db=reporting --out=events.json

74 file that contains the root certificate chain from the Certificate Authority. Specify the file name of the

mongoexport --collection=events --db=reporting --out=events.json

74 file using relative or absolute paths.

Chỉ định cổng TCP mà phiên bản MongoDB lắng nghe các kết nối máy khách.

mongoexport --collection=events --db=reporting --out=events.json

63. Providing a connection string while also using

mongoexport --collection=events --db=reporting --out=events.json

78
and specifying conflicting information will result in an error.

Ngoài ra, bạn cũng có thể chỉ định tên máy chủ trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

2 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients.

mongoexport --collection=events --db=reporting --out=events.json

65Default: 27017

Specifies the

mongoexport --collection=events --db=reporting --out=events.json

74 file that contains both the TLS/SSL certificate and key. Specify the file name of the

mongoexport --collection=events --db=reporting --out=events.json

74 file using relative or absolute paths.

Chỉ định cổng TCP mà phiên bản MongoDB lắng nghe các kết nối máy khách.

mongoexport --collection=events --db=reporting --out=events.json

68 option to connect to a

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7
or

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4
that has

mongoexport --collection=events --db=reporting --out=events.json

85
enabled without

mongoexport --collection=events --db=reporting --out=events.json

86

Ngoài ra, bạn cũng có thể chỉ định cổng trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

4 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --collection=events --db=reporting --out=events.json

89
and specifying conflicting information will result in an error.

Ngoài ra, bạn cũng có thể chỉ định tên máy chủ trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

2 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients.

mongoexport --collection=events --db=reporting --out=events.json

65Default: 27017

Specifies the password to de-crypt the certificate-key file (i.e.

mongoexport --collection=events --db=reporting --out=events.json

89). Use the

mongoexport --collection=events --db=reporting --out=events.json

39
option only if the certificate-key file is encrypted. In all cases, the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
will redact the password from all logging and reporting output.

Nếu khóa riêng trong tệp PEM được mã hóa và bạn không chỉ định tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

39,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 sẽ nhắc nhở cho cụm mật khẩu. Xem Cụm mật khẩu Chứng chỉ TLS/SSL.

mongoexport --collection=events --db=reporting --out=events.json

39
option, the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
will prompt for a passphrase. See TLS/SSL Certificate Passphrase.

Ngoài ra, bạn cũng có thể chỉ định mật khẩu trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --collection=events --db=reporting --out=events.json

39 và chỉ định thông tin xung đột sẽ dẫn đến lỗi.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --collection=events --db=reporting --out=events.json

39
and specifying conflicting information will result in an error.

Để biết thêm thông tin về TLS/SSL và MongoDB, hãy xem Cấu hình MongoD và Mongo cho cấu hình TLS/SSL và TLS/SSL cho máy khách.Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients.

Cảnh báo

Trên một số hệ thống, mật khẩu được cung cấp trực tiếp bằng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

39 có thể hiển thị cho các chương trình trạng thái hệ thống như

mongoexport --collection=events --db=reporting --out=events.json

54 có thể được gọi bởi những người dùng khác. Xem xét sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

55 để chỉ định tệp cấu hình có chứa mật khẩu thay thế.

mongoexport --collection=events --db=reporting --out=events.json

39
option may be visible to system status programs such as

mongoexport --collection=events --db=reporting --out=events.json

54 that may be invoked by other users. Consider using the

mongoexport --collection=events --db=reporting --out=events.json

55
option to specify a configuration file containing the password instead.

‘ Chỉ định tên tệp của tệp

mongoexport --collection=events --db=reporting --out=events.json

74 bằng các đường dẫn tương đối hoặc tuyệt đối.

Specifies the

mongoexport --collection=events --db=reporting --out=events.json

74 file that contains the Certificate Revocation List. Specify the file name of the

mongoexport --collection=events --db=reporting --out=events.json

74 file using relative or absolute paths.

Để biết thêm thông tin về TLS/SSL và MongoDB, hãy xem Cấu hình MongoD và Mongo cho cấu hình TLS/SSL và TLS/SSL cho máy khách.Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients.

Cảnh báo

Bypasses the validation checks for server certificates and allows the use of invalid certificates. When using the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

05 setting, MongoDB logs as a warning the use of the invalid certificate.

Cảnh báo

Trên một số hệ thống, mật khẩu được cung cấp trực tiếp bằng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

39 có thể hiển thị cho các chương trình trạng thái hệ thống như

mongoexport --collection=events --db=reporting --out=events.json

54 có thể được gọi bởi những người dùng khác. Xem xét sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

55 để chỉ định tệp cấu hình có chứa mật khẩu thay thế.

‘ Chỉ định tên tệp của tệp

mongoexport --collection=events --db=reporting --out=events.json

74 bằng các đường dẫn tương đối hoặc tuyệt đối.

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7
or

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4
instance without validating server certificates is a potential security risk. If you only need to disable the validation of the hostname in the TLS/SSL certificates, see

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

10.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

04Bypasses Kiểm tra xác thực cho chứng chỉ máy chủ và cho phép sử dụng các chứng chỉ không hợp lệ. Khi sử dụng cài đặt

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

05, MongoDB ghi nhật ký như một cảnh báo về việc sử dụng chứng chỉ không hợp lệ.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

04
and specifying conflicting information will result in an error.

Để biết thêm thông tin về TLS/SSL và MongoDB, hãy xem Cấu hình MongoD và Mongo cho cấu hình TLS/SSL và TLS/SSL cho máy khách.Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients.

Cảnh báo

Disables the validation of the hostnames in TLS/SSL certificates. Allows

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 to connect to MongoDB instances even if the hostname in their certificates do not match the specified hostname.

Trên một số hệ thống, mật khẩu được cung cấp trực tiếp bằng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

39 có thể hiển thị cho các chương trình trạng thái hệ thống như

mongoexport --collection=events --db=reporting --out=events.json

54 có thể được gọi bởi những người dùng khác. Xem xét sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

55 để chỉ định tệp cấu hình có chứa mật khẩu thay thế.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

10
and specifying conflicting information will result in an error.

Để biết thêm thông tin về TLS/SSL và MongoDB, hãy xem Cấu hình MongoD và Mongo cho cấu hình TLS/SSL và TLS/SSL cho máy khách.Configure mongod and mongos for TLS/SSL and TLS/SSL Configuration for Clients.

Cảnh báo

Specifies a username with which to authenticate to a MongoDB database that uses authentication. Use in conjunction with the

mongoexport --collection=events --db=reporting --out=events.json

37 and

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

19
options.

Trên một số hệ thống, mật khẩu được cung cấp trực tiếp bằng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

39 có thể hiển thị cho các chương trình trạng thái hệ thống như

mongoexport --collection=events --db=reporting --out=events.json

54 có thể được gọi bởi những người dùng khác. Xem xét sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

55 để chỉ định tệp cấu hình có chứa mật khẩu thay thế.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --collection=events --db=reporting --out=events.json

51
and specifying conflicting information will result in an error.

‘ Chỉ định tên tệp của tệp

mongoexport --collection=events --db=reporting --out=events.json

74 bằng các đường dẫn tương đối hoặc tuyệt đối.MongoDB Atlas cluster using the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23
, you can specify your AWS access key ID in:

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    04Bypasses Kiểm tra xác thực cho chứng chỉ máy chủ và cho phép sử dụng các chứng chỉ không hợp lệ. Khi sử dụng cài đặt

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    05, MongoDB ghi nhật ký như một cảnh báo về việc sử dụng chứng chỉ không hợp lệ.

  • Mặc dù có sẵn, tránh sử dụng tùy chọn

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    04 nếu có thể. Nếu việc sử dụng

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    04 là cần thiết, chỉ sử dụng tùy chọn trên các hệ thống không thể xâm nhập.

    mongoexport --collection=events --db=reporting --out=events.json

    50
    , or

  • Kết nối với phiên bản

    mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

    7 hoặc

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    4 mà không xác thực chứng chỉ máy chủ là rủi ro bảo mật tiềm ẩn. Nếu bạn chỉ cần vô hiệu hóa việc xác thực tên máy chủ trong chứng chỉ TLS/SSL, hãy xem

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    10.

Ngoài ra, bạn cũng có thể vô hiệu hóa xác thực chứng chỉ trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

04 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.Connect to a MongoDB Atlas Cluster using AWS IAM Credentials for an example of each.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

10Disable Việc xác thực tên máy chủ trong chứng chỉ TLS/SSL. Cho phép

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 kết nối với các phiên bản MongoDB ngay cả khi tên máy chủ trong chứng chỉ của họ không khớp với tên máy chủ được chỉ định.

Specifies a password with which to authenticate to a MongoDB database that uses authentication. Use in conjunction with the

mongoexport --collection=events --db=reporting --out=events.json

51 and

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

19
options.

Ngoài ra, bạn cũng có thể vô hiệu hóa xác thực tên máy chủ trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

10 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.

mongoexport --collection=events --db=reporting --out=events.json

51
option without

mongoexport --collection=events --db=reporting --out=events.json

37
or specify an empty string as the

mongoexport --collection=events --db=reporting --out=events.json

37
value, as in

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

32 .

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

17 chỉ định tên người dùng để xác thực vào cơ sở dữ liệu MongoDB sử dụng xác thực. Sử dụng kết hợp với các tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

37 và

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

19.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --collection=events --db=reporting --out=events.json

37
and specifying conflicting information will result in an error.

Ngoài ra, bạn cũng có thể chỉ định tên người dùng trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --collection=events --db=reporting --out=events.json

51 và chỉ định thông tin xung đột sẽ dẫn đến lỗi.MongoDB Atlas cluster using the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23
, you can specify your AWS secret access key in:

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    04Bypasses Kiểm tra xác thực cho chứng chỉ máy chủ và cho phép sử dụng các chứng chỉ không hợp lệ. Khi sử dụng cài đặt

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    05, MongoDB ghi nhật ký như một cảnh báo về việc sử dụng chứng chỉ không hợp lệ.

  • Mặc dù có sẵn, tránh sử dụng tùy chọn

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    04 nếu có thể. Nếu việc sử dụng

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    04 là cần thiết, chỉ sử dụng tùy chọn trên các hệ thống không thể xâm nhập.

    mongoexport --collection=events --db=reporting --out=events.json

    50
    , or

  • Kết nối với phiên bản

    mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

    7 hoặc

    mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

    4 mà không xác thực chứng chỉ máy chủ là rủi ro bảo mật tiềm ẩn. Nếu bạn chỉ cần vô hiệu hóa việc xác thực tên máy chủ trong chứng chỉ TLS/SSL, hãy xem

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    10.

Ngoài ra, bạn cũng có thể vô hiệu hóa xác thực chứng chỉ trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

04 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.Connect to a MongoDB Atlas Cluster using AWS IAM Credentials for an example of each.

Cảnh báo

Trên một số hệ thống, mật khẩu được cung cấp trực tiếp bằng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

39 có thể hiển thị cho các chương trình trạng thái hệ thống như

mongoexport --collection=events --db=reporting --out=events.json

54 có thể được gọi bởi những người dùng khác. Xem xét sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

55 để chỉ định tệp cấu hình có chứa mật khẩu thay thế.

mongoexport --collection=events --db=reporting --out=events.json

37
option may be visible to system status programs such as

mongoexport --collection=events --db=reporting --out=events.json

54 that may be invoked by other users. Consider instead:

  • ‘ Chỉ định tên tệp của tệp

    mongoexport --collection=events --db=reporting --out=events.json

    74 bằng các đường dẫn tương đối hoặc tuyệt đối.

    mongoexport --collection=events --db=reporting --out=events.json

    37
    option to receive an interactive password prompt, or

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    04Bypasses Kiểm tra xác thực cho chứng chỉ máy chủ và cho phép sử dụng các chứng chỉ không hợp lệ. Khi sử dụng cài đặt

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    05, MongoDB ghi nhật ký như một cảnh báo về việc sử dụng chứng chỉ không hợp lệ.

    mongoexport --collection=events --db=reporting --out=events.json

    55
    option to specify a configuration file containing the password.

Mặc dù có sẵn, tránh sử dụng tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

04 nếu có thể. Nếu việc sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

04 là cần thiết, chỉ sử dụng tùy chọn trên các hệ thống không thể xâm nhập.

If connecting to a MongoDB Atlas cluster using the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23
, and using session tokens in addition to your AWS access key ID and secret access key, you can specify your AWS session token in:

  • vùng này,

  • tham số

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    46

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    47 cho

    mongoexport --collection=events --db=reporting --out=events.json

    50 hoặc

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    47
    parameter to the

    mongoexport --collection=events --db=reporting --out=events.json

    50
    , or

  • Biến môi trường

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    46.

Xem Kết nối với cụm Atlas MongoDB bằng cách sử dụng thông tin xác thực AWS IAM để biết ví dụ về từng thông tin.Connect to a MongoDB Atlas Cluster using AWS IAM Credentials for an example of each.

Chỉ hợp lệ khi sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

52SPECECTION Cơ sở dữ liệu xác thực trong đó

mongoexport --collection=events --db=reporting --out=events.json

51 được chỉ định đã được tạo. Xem cơ sở dữ liệu xác thực.

Specifies the authentication database where the specified

mongoexport --collection=events --db=reporting --out=events.json

51 has been created. See Authentication Database.

Nếu bạn không chỉ định cơ sở dữ liệu xác thực,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 giả định rằng cơ sở dữ liệu được chỉ định để xuất giữ thông tin đăng nhập của người dùng.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
assumes that the database specified to export holds the user's credentials.

Nếu sử dụng GSSAPI (Kerberos), Plain (LDAP SASL) hoặc

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

56, bạn phải đặt

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

19 thành

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

58.GSSAPI (Kerberos), PLAIN (LDAP SASL), or

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

56
, you must set

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

19
to

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

58.

Ngoài ra, bạn cũng có thể chỉ định cơ sở dữ liệu xác thực trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

19 và chỉ định thông tin xung đột sẽ dẫn đến lỗi.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

19
and specifying conflicting information will result in an error.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

61Default: Scram-sha-1

Default: SCRAM-SHA-1

Chỉ định cơ chế xác thực, ví dụ

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 sử dụng để xác thực với

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7 hoặc

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
instance uses to authenticate to the

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7
or

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4

Đã thay đổi trong phiên bản 100.1.0: Bắt đầu từ phiên bản

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

65,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 bổ sung hỗ trợ cho cơ chế xác thực

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22 khi kết nối với cụm Atlas MongoDB.MongoDB Atlas ` cluster.

Ngoài ra, bạn cũng có thể chỉ định cơ chế xác thực trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

69 và chỉ định thông tin mâu thuẫn sẽ dẫn đến lỗi.

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

69
and specifying conflicting information will result in an error.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

70Specify tên của dịch vụ bằng GSSAPI/Kerberos. Chỉ yêu cầu nếu dịch vụ không sử dụng tên mặc định là

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

71.

Specify the name of the service using GSSAPI/Kerberos. Only required if the service does not use the default name of

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

71.

Tùy chọn này chỉ có sẵn trong MongoDB Enterprise.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

72Specify tên máy chủ của dịch vụ bằng GSSAPI/Kerberos. Chỉ yêu cầu nếu tên máy chủ của máy không khớp với tên máy chủ được giải quyết bằng DNS.

Specify the hostname of a service using GSSAPI/Kerberos. Only required if the hostname of a machine does not match the hostname resolved by DNS.

Tùy chọn này chỉ có sẵn trong MongoDB Enterprise.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

72Specify tên máy chủ của dịch vụ bằng GSSAPI/Kerberos. Chỉ yêu cầu nếu tên máy chủ của máy không khớp với tên máy chủ được giải quyết bằng DNS.

Specifies the name of the database on which to run the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

73 chỉ định tên của cơ sở dữ liệu để chạy

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5

mongoexport --collection=events --db=reporting --out=events.json

63
. Providing a connection string while also using

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

76
and specifying conflicting information will result in an error.

Ngoài ra, bạn cũng có thể chỉ định cơ sở dữ liệu trực tiếp trong

mongoexport --collection=events --db=reporting --out=events.json

63. Cung cấp chuỗi kết nối đồng thời sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

76 và chỉ định thông tin xung đột sẽ dẫn đến lỗi.

Specifies the collection to export.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

77 Chỉ định bộ sưu tập để xuất.

Specifies a field or fields to include in the export. Use a comma separated list of fields to specify multiple fields.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

78 chỉ định một trường hoặc các trường để đưa vào xuất khẩu. Sử dụng danh sách các trường phân tách dấu phẩy để chỉ định nhiều trường.

Nếu bất kỳ tên trường nào của bạn bao gồm không gian trắng, hãy sử dụng dấu ngoặc kép để gửi danh sách trường. Ví dụ: nếu bạn muốn xuất hai trường,

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

79 và

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

80, bạn sẽ chỉ định

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

81.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

82
output formats,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
includes only the specified field(s), and the specified field(s) can be a field within a sub-document.

Đối với các định dạng đầu ra

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

82,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 chỉ bao gồm (các) trường được chỉ định và (các) trường được chỉ định có thể là một trường trong một tài liệu phụ.JSON output formats,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
includes only the specified field(s) and the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

85 field, and if the specified field(s) is a field within a sub-document, the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
includes the sub-document with all its fields, not just the specified field within the document.

Đối với các định dạng đầu ra của JSON,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 chỉ bao gồm (các) trường được chỉ định và trường

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

85 và nếu (các) trường được chỉ định là một trường trong một tài liệu phụ,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 bao gồm cả tài liệu phụ với tất cả các trường của nó, không chỉ Trường được chỉ định trong tài liệu.Export Data in CSV Format using

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

87 option
for sample usage.

Xem: Xuất dữ liệu ở định dạng CSV bằng cách sử dụng tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

87 để sử dụng mẫu.

An alternative to

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

87. The

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

90
option allows you to specify in a file the field or fields to include in the export and is only valid with the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

91
option with value

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

82. The file must have only one field per line, and the line(s) must end with the LF character (

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

93).

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

88an ​​thay thế cho

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

87. Tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

90 cho phép bạn chỉ định trong tệp trường hoặc trường để đưa vào xuất và chỉ có giá trị với tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

91 với giá trị

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

82. Tệp chỉ phải có một trường trên mỗi dòng và (các) dòng phải kết thúc bằng ký tự LF (

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

93). includes only the specified field(s). The specified field(s) can be a field within a sub-document.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 chỉ bao gồm (các) trường được chỉ định. (Các) trường được chỉ định có thể là một trường trong một tài liệu phụ.Use a File to Specify the Fields to Export in CSV Format for sample usage.

Xem Sử dụng tệp để chỉ định các trường để xuất ở định dạng CSV để sử dụng mẫu.

Provides a query as a JSON document (enclosed in quotes) to return matching documents in the export.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

95 cung cấp một truy vấn dưới dạng tài liệu JSON (kèm theo trích dẫn) để trả về các tài liệu phù hợp trong xuất khẩu.

Bạn phải gửi kèm theo tài liệu truy vấn trong các trích dẫn đơn (

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

96) để đảm bảo rằng nó không tương tác với môi trường vỏ của bạn.must be in Extended JSON v2 format (either relaxed or canonical/strict mode), including enclosing the field names and operators in quotes:

Truy vấn phải ở định dạng JSON V2 mở rộng (chế độ thư giãn hoặc chính tắc/nghiêm ngặt), bao gồm bao gồm các tên trường và toán tử trong trích dẫn:

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

4

Ví dụ: được cung cấp một bộ sưu tập có tên

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

97 trong cơ sở dữ liệu

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

98 với các tài liệu sau:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
uses the

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

00
option to export only the documents with the field

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

01 greater than or equal to (

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

02
) to

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

03 and the field

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

04 less than

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

05 (using the extended JSON v2 format (relaxed mode) for dates { "$date": "YYYY-MM-DDTHH:mm:ss.mmm"}):

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

5

Các

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 sau đây sử dụng tùy chọn

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

00 để chỉ xuất các tài liệu với trường

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

01 lớn hơn hoặc bằng (

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

02) sang

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

03 và trường

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

04 nhỏ hơn

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

05 (sử dụng định dạng JSON v2 mở rộng (chế độ thư giãn) ":" Yyyy-mm-ddthh: mm: ss.mmm "}):

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

6

Tệp kết quả chứa các tài liệu sau:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

06 option to

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5

Bạn có thể sắp xếp kết quả với tùy chọn

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

06 thành

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5

Default: json

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

08Default: JSONCSV format or

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

10 for JSON format.

Nếu bạn chỉ định

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

82, thì bạn cũng phải sử dụng tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

87 hoặc

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

90 để khai báo các trường để xuất từ ​​bộ sưu tập.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

87
or the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

90
option to declare the fields to export from the collection.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

14 chỉ định một tệp để viết xuất khẩu. Nếu bạn không chỉ định tên tệp,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 ghi dữ liệu vào đầu ra tiêu chuẩn (ví dụ:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

16).

Specifies a file to write the export to. If you do not specify a file name, the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 writes data to standard output (e.g.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

16).

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

17Default: Thư giãn

Default: relaxed

Sửa đổi đầu ra để sử dụng chế độ kinh điển hoặc thư giãn của định dạng JSON (V2) của MongoDB.MongoDB Extended JSON (v2) format.

Để biết sự khác biệt giữa các chế độ kinh điển và thư giãn, xem MongoDB mở rộng JSON (V2).MongoDB Extended JSON (v2).

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

18 Điều chỉnh đầu ra của

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 để viết toàn bộ nội dung của xuất khẩu dưới dạng một mảng JSON duy nhất. Theo mặc định

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 ghi dữ liệu bằng một tài liệu JSON cho mỗi tài liệu MongoDB.

Modifies the output of

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 to write the entire contents of the export as a single JSON array. By default

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
writes data using one JSON document for every MongoDB document.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

21Outputs Tài liệu theo định dạng được in đẹp.

Outputs documents in a pretty-printed format JSON.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22BY Mặc định,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 bao gồm các tên trường được xuất dưới dạng dòng đầu tiên trong đầu ra CSV.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22 chỉ đạo

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 để xuất dữ liệu mà không có danh sách tên trường.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22 chỉ có giá trị với tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

91 với giá trị

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

82.

By default,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 includes the exported field names as the first line in a CSV output.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22
directs

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
to export the data without the list of field names.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22
is only valid with the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

91
option with value

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

82.

Xem loại trừ tên trường khỏi đầu ra CSV để sử dụng mẫu.Exclude Field Names from CSV Output for sample usage.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

29default:

mongoexport --collection=events --db=reporting --out=events.json

11

Default:

mongoexport --collection=events --db=reporting --out=events.json

11

Chỉ định ưu tiên đọc cho

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5. Tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2 có thể lấy:read preference for

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
. The

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2
option can take:

  • Một chuỗi nếu chỉ chỉ định chế độ ưu tiên đọc:

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    7

  • Một tài liệu được bao gồm báo giá để chỉ định chế độ, các bộ thẻ ưu tiên đọc tùy chọn và MaxStalessionSeconds tùy chọn:read preference tag sets, and the optional maxStalenessSeconds:

    mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    8

    Nếu chỉ định MaxStalessionSeconds, giá trị phải lớn hơn hoặc bằng 90.maxStalenessSeconds, the value must be greater than or equal to 90.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Mặc định là ưu tiên

mongoexport --collection=events --db=reporting --out=events.json

11Read. defaults to

mongoexport --collection=events --db=reporting --out=events.json

11
read preference.

Nếu sở thích đọc cũng được bao gồm trong

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

0, dòng lệnh

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2 sẽ ghi đè lên sở thích đọc được chỉ định trong chuỗi URI.

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

0
, the command-line

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

2
overrides the read preference specified in the URI string.

Cảnh báo

Sử dụng một sở thích đọc khác với

mongoexport --collection=events --db=reporting --out=events.json

11 với kết nối với

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4 có thể tạo ra sự không nhất quán, trùng lặp hoặc dẫn đến các tài liệu bị bỏ lỡ.read preference other than

mongoexport --collection=events --db=reporting --out=events.json

11
with a connection to a

mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary&readPreferenceTags=region:east" --collection=events --out=events.json [additional options]

4
may produce inconsistencies, duplicates, or result in missed documents.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

39use

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

40 để kiểm soát nơi

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 bắt đầu xuất tài liệu. Xem

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

42 để biết thông tin về hoạt động cơ bản.

Use

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

40 to control where

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
begins exporting documents. See

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

42
for information about the underlying operation.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

43 chỉ định số lượng tài liệu tối đa để đưa vào xuất khẩu. Xem

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

44 để biết thông tin về hoạt động cơ bản.

Specifies a maximum number of documents to include in the export. See

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

44 for information about the underlying operation.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

45 chỉ định một đơn đặt hàng cho kết quả xuất khẩu. Nếu một chỉ mục không tồn tại có thể hỗ trợ hoạt động sắp xếp, kết quả phải nhỏ hơn 32 megabyte.

Specifies an ordering for exported results. If an index does not exist that can support the sort operation, the results must be less than 32 megabytes.

Sử dụng

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

06 Kết hợp với

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

40 và

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

48 để hạn chế số lượng tài liệu xuất.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

06
conjunction with

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

40
and

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

48
to limit number of exported documents.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

9

Xem

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

49 để biết thông tin về hoạt động cơ bản.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

49
for information about the underlying operation.

Chạy

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 từ dòng lệnh hệ thống, không phải shell

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

7.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
from the system command line, not the

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

7
shell.

Trong ví dụ sau,

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 xuất dữ liệu từ bộ sưu tập

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

53 trong cơ sở dữ liệu

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

54 ở định dạng CSV sang tệp

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

55.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
exports data from the collection

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

53 collection in the

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

54 database in CSV format to the file

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

55.

Ví dụ

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7 mà

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 kết nối với đang chạy trên số cổng localhost

mongoexport --collection=events --db=reporting --out=events.json

58.

mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017" --readPreference=secondary --collection=events --db=reporting --out=events.json [additional options]

7
instance that

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
connects to is running on the localhost port number

mongoexport --collection=events --db=reporting --out=events.json

58.

Khi bạn xuất ở định dạng CSV, bạn phải chỉ định các trường trong các tài liệu để xuất. Hoạt động chỉ định các trường

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

59 và

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

60 để xuất.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

0

Đầu ra sau đó sẽ giống với:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

1

Chỉ để xuất CSV, bạn cũng có thể chỉ định các trường trong một tệp chứa danh sách các trường được phân tách dòng để xuất. Tệp phải chỉ có một trường trên mỗi dòng.

Ví dụ: bạn có thể chỉ định các trường

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

59 và

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

60 trong tệp

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

63:

Sau đó, sử dụng tùy chọn

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

90, chỉ định các trường để xuất với tệp:

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

90
option, specify the fields to export with the file:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

2

Tùy chọn

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22 có thể được sử dụng để loại trừ tên trường trong xuất CSV. Ví dụ sau xuất các trường

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

59 và

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

60 trong bộ sưu tập

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

53 trong cơ sở dữ liệu

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

54 và sử dụng

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22 để triệt tiêu đầu ra của tên trường làm dòng đầu tiên:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22
option can be used to exclude field names in a CSV export. The following example exports the

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

59 and

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

60 fields in the

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

53 collection in the

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

54 database and uses

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

22
to suppress the output of the field names as the first line:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

3

Đầu ra CSV sau đó sẽ giống với:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

4

Ví dụ này tạo ra xuất khẩu bộ sưu tập

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

53 từ phiên bản MongoDB chạy trên số cổng localhost

mongoexport --collection=events --db=reporting --out=events.json

58. Điều này viết xuất khẩu vào tệp

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

73 ở định dạng JSON.JSON format.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

5

Ví dụ sau xuất khẩu bộ sưu tập

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

53 trong cơ sở dữ liệu

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

75 từ một ví dụ MongoDB từ xa yêu cầu xác thực.

Chỉ định la:

  • mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    2

  • mongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName&readPreference=secondary" --collection=events --out=events.json [additional options]

    4

  • mongoexport --collection=events --db=reporting --out=events.json

    51

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    19

  • mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

    80

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    76

  • mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

    82

Mẹo

Bỏ qua tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

37 để có lời nhắc

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 cho mật khẩu:

mongoexport --collection=events --db=reporting --out=events.json

37
option to have

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 prompt for the password:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

6

Ngoài ra, bạn sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

38 để chỉ định máy chủ, cổng, tên người dùng, cơ sở dữ liệu xác thực và DB.

mongoexport --collection=events --db=reporting --out=events.json

38
option to specify the host, port, username, authentication database, and db.

Mẹo

Bỏ qua tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

37 để có lời nhắc

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 cho mật khẩu:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

7

Ngoài ra, bạn sử dụng tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

38 để chỉ định máy chủ, cổng, tên người dùng, cơ sở dữ liệu xác thực và DB.

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

87
option, and limit the results to a single database using the "

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

76
" option.

Chẳng hạn, lệnh này trả về tất cả các tài liệu trong bộ sưu tập

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

53 của cơ sở dữ liệu ____389 có chứa một trường có tên

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

91 bằng

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

92 và trường

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

04 lớn hơn hoặc bằng isodate ("2018-01-01") "$ ngày": "Yyyy-mm-ddthh: mm: ss.mmm"}))canonical format for dates { "$date": "YYYY-MM-DDTHH:mm:ss.mmm"} )

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

8

Bạn phải gửi kèm theo tài liệu truy vấn trong các trích dẫn đơn (

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

96) để đảm bảo rằng nó không tương tác với môi trường vỏ của bạn.

Mới trong phiên bản 100.1.0.

Để kết nối với cụm Atlas MongoDB đã được cấu hình để hỗ trợ xác thực thông qua thông tin xác thực AWS IAM, cung cấp

mongoexport --collection=events --db=reporting --out=events.json

50 đến

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 tương tự như sau:MongoDB Atlas cluster which has been configured to support authentication via AWS IAM credentials, provide a

mongoexport --collection=events --db=reporting --out=events.json

50
to

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
similar to the following:

mongoexport --host="mongodb0.example.com:27017" --collection=events --db=reporting --out=events.json [additional options]

9

Kết nối với Atlas bằng thông tin AWS IAM theo cách này sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23 và

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

58

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

00, như trong ví dụ này.

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23
and the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

58

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

00
, as shown in this example.

Nếu sử dụng mã thông báo phiên AWS, cũng sẽ cung cấp cho nó giá trị

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

46

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

47, như sau:AWS session token, as well, provide it with the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

46

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

47
value, as follows:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

0

Ghi chú

Nếu ID khóa truy cập AWS, khóa truy cập bí mật hoặc mã thông báo phiên bao gồm các ký tự sau:

Những ký tự đó phải được chuyển đổi bằng cách sử dụng phần trăm mã hóa.percent encoding.

Ngoài ra, ID khóa truy cập AWS, khóa truy cập bí mật và mã thông báo phiên tùy chọn có thể được cung cấp bên ngoài chuỗi kết nối bằng các tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

51,

mongoexport --collection=events --db=reporting --out=events.json

37 và

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

05 thay vào đó, như vậy:

mongoexport --collection=events --db=reporting --out=events.json

51
,

mongoexport --collection=events --db=reporting --out=events.json

37
, and

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

05
options instead, like so:

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

1

Khi được cung cấp dưới dạng tham số dòng lệnh, ba tùy chọn này không yêu cầu mã hóa phần trăm.

Bạn cũng có thể đặt các thông tin này trên nền tảng của mình bằng các biến môi trường AWS IAM tiêu chuẩn.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Kiểm tra các biến môi trường sau khi bạn sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23AWS IAM environment variables.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5
checks for the following environment variables when you use the

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    25

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    38

  • mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

    46

Nếu được đặt, các thông tin đăng nhập này không cần được chỉ định trong chuỗi kết nối hoặc thông qua các tùy chọn rõ ràng của chúng.

Ghi chú

Nếu ID khóa truy cập AWS, khóa truy cập bí mật hoặc mã thông báo phiên bao gồm các ký tự sau:or specify each of these using the explicit or connection string options instead.

Những ký tự đó phải được chuyển đổi bằng cách sử dụng phần trăm mã hóa.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

2

Ngoài ra, ID khóa truy cập AWS, khóa truy cập bí mật và mã thông báo phiên tùy chọn có thể được cung cấp bên ngoài chuỗi kết nối bằng các tùy chọn

mongoexport --collection=events --db=reporting --out=events.json

51,

mongoexport --collection=events --db=reporting --out=events.json

37 và

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

05 thay vào đó, như vậy:

Khi được cung cấp dưới dạng tham số dòng lệnh, ba tùy chọn này không yêu cầu mã hóa phần trăm.

Bạn cũng có thể đặt các thông tin này trên nền tảng của mình bằng các biến môi trường AWS IAM tiêu chuẩn.

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

5 Kiểm tra các biến môi trường sau khi bạn sử dụng

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

22

mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]

23

mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]

3

Làm cách nào để xuất và nhập MongoDB?

Procedure..
Kết nối với triển khai có chứa bộ sưu tập bạn muốn nhập dữ liệu vào.....
Điều hướng đến bộ sưu tập mục tiêu của bạn.....
Nhấp vào Thêm thả xuống dữ liệu và chọn Nhập tệp.....
Chọn vị trí của tệp dữ liệu nguồn trong tệp chọn ..
Chọn loại tệp thích hợp.....
Định cấu hình các tùy chọn nhập.....
Nhấp vào nhập ..

Làm cách nào để xuất toàn bộ cơ sở dữ liệu MongoDB?

Vì vậy, để xuất dữ liệu từ cơ sở dữ liệu MongoDB, MongoDB cung cấp một công cụ dòng lệnh được gọi là MongoExport.Sử dụng công cụ này, bạn có thể xuất dữ liệu của một bộ sưu tập trong định dạng JSON hoặc CSV (giá trị phân tách bằng dấu phẩy).Hơn nữa, chúng tôi cũng có thể sử dụng các tính năng như giới hạn và sắp xếp trên một bộ sưu tập trong khi xuất dữ liệu.MongoDB provides a command-line tool known as mongoexport. Using this tool you can exports data of a collection in JSON or CSV(comma-separated value) format. Moreover, we can also use features like limit and sort on a collection while exporting the data.

Làm cách nào để nhập toàn bộ cơ sở dữ liệu vào MongoDB?

Để nhập dữ liệu vào cơ sở dữ liệu MongoDB, bạn có thể sử dụng Mongoimport để nhập dữ liệu bộ sưu tập cụ thể hoặc bạn có thể sử dụng MongoRestore để nhập bản sao lưu cơ sở dữ liệu đầy đủ nhị phân (BSON).Tệp cơ sở dữ liệu được xuất phải được lưu trữ cục bộ trên cùng một máy với máy khách của bạn.use mongorestore to import a binary (BSON) full database backup. The exported database file must be stored locally on the same machine as your client.