Tài liệu về nhà → la bàn MongoDB → MongoDB Compass
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.
La bàn hiển thị hộp thoại sau:
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.
Để 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 MongoDB → MongoDB 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] 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] 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à
0. Trước đây,
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
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]
Tài liệu này dành cho phiên bản
3 củamongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --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ảnmongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --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" --collection=events --out=events.json [additional options]
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:
MongoDB 4.2 | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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ù 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] 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] | Mặc dù 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ù 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ù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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ù 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] 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] | Mặc dù 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ù 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ù 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] 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] | Mặc dù 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ù 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ù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] 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] | Mặc dù 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] mongoexport --host="myReplicaSetName/mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com" --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 to export. If you do not specify an
6,
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í.
0mongoexport --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]
mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
Bắt đầu với MongoDB 4.4,
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 --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
0. Trước đây,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]
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]
0, the database can be specified as part of the string.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]
Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của
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]
2mongoexport --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]
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
3 củamongoexport --uri="mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/reporting?replicaSet=myReplicaSetName" --collection=events --out=events.json [additional options]
5.mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
2 andmongoexport --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]
4mongoexport --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]
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
0mongoexport --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]
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,
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 --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
0. Trước đây,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]
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]
0, the database can be specified as part of the string.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]
Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của
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]
2mongoexport --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]
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:
5 Phiên bảnmongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --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" --collection=events --out=events.json [additional options]
0mongoexport --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]
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
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]
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,
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 --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
0. Trước đây,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]
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]
0, the database can be specified as part of the string.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]
Đối với tài liệu trên MongoDB 4.2 hoặc các phiên bản trước của
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]
2 command-line option. The command-line option takes a string if specifying only the read preference mode: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]
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
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 --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]
0mongoexport --collection=events --db=reporting --out=events.json
Để 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
4 trongmongoexport --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]
0mongoexport --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 instance in themongoexport --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]
0mongoexport --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]
1mongoexport --collection=events --db=reporting --out=events.json
Khi sử dụng
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.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]
Chỉ định tên máy chủ và cổng của phiên bản
4 trongmongoexport --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]
2mongoexport --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 instance in themongoexport --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]
2mongoexport --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]
2mongoexport --collection=events --db=reporting --out=events.json
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
0mongoexport --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]
0mongoexport --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]
3mongoexport --collection=events --db=reporting --out=events.json
Nếu chỉ định các thẻ ưu tiên đọc, bao gồm tùy chọn
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]
4mongoexport --collection=events --db=reporting --out=events.json
Khi sử dụng
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.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]
Chỉ định tên máy chủ và cổng của phiên bản
4 trongmongoexport --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]
2mongoexport --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 command-line option. The command-line option takes a string if specifying only the read preference mode: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]
5mongoexport --collection=events --db=reporting --out=events.json
Hoặc, tùy chọn dòng lệnh có thể có một tài liệu được bao gồm
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 --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]
6mongoexport --collection=events --db=reporting --out=events.json
Để 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]
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]
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]
2mongoexport --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
7Nế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] 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]
7
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]
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]
0mongoexport --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.
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]
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.
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]
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]
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 mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
00 không được xác định,
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]
7mongoexport --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
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]
0Increases 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à [
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 --collection=events --db=reporting --out=events.json
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.mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
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 [
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.mongoexport --collection=events --db=reporting --out=events.json
Cũng có những hạn chế đối với việc sử dụng
8 vàmongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
5 với [mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
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
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]
5Returns 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:
37mongoexport --collection=events --db=reporting --out=events.json
38mongoexport --collection=events --db=reporting --out=events.json
39mongoexport --collection=events --db=reporting --out=events.json
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
8Hoạ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
9Bắ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]
0Là 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]
1Chỉ 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.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
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
47 hoặcmongoexport --collection=events --db=reporting --out=events.json
48. Ví dụ:mongoexport --collection=events --db=reporting --out=events.json
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
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.mongoexport --collection=events --db=reporting --out=events.json
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]
2Trê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]
3Sử 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: 27017mongoexport --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] 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]
7 or
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: 27017Specifies 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 mongoexport --collection=events --db=reporting --out=events.json
63. Providing a connection string while also using
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: 27017Specifies 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 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] 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] mongoexport --collection=events --db=reporting --out=events.json
68 option to connect to a
7 or
4 that has
mongoexport --collection=events --db=reporting --out=events.json
86Ngoà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: 27017Specifies the password to de-crypt the
certificate-key file [i.e. mongoexport --collection=events --db=reporting --out=events.json mongoexport --collection=events --db=reporting --out=events.json mongoexport --host="mongodb0.example.com" --port=27017 --collection=events --db=reporting --out=events.json [additional options]
89]. Use the
39 option only if the certificate-key file is encrypted. In all cases, the
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áoBypasses 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áoDisables 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áoSpecifies 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 mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
37 and
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:
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 đặtmongoexport --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 --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
Mặc dù có sẵn, tránh sử dụng tùy chọn
04 nếu có thể. Nếu việc sử dụngmongoexport --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 --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
50, ormongoexport --collection=events --db=reporting --out=events.json
Kết nối với phiên bản
7 hoặcmongoexport --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]
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 xemmongoexport --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]
10.mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
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 mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
51 and
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:
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 đặtmongoexport --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 --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
Mặc dù có sẵn, tránh sử dụng tùy chọn
04 nếu có thể. Nếu việc sử dụngmongoexport --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 --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
50, ormongoexport --collection=events --db=reporting --out=events.json
Kết nối với phiên bản
7 hoặcmongoexport --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]
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 xemmongoexport --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]
10.mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
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
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, ormongoexport --collection=events --db=reporting --out=events.json
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 đặtmongoexport --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 --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
55 option to specify a configuration file containing the password.mongoexport --collection=events --db=reporting --out=events.json
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ố
46mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
47 chomongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
50 hoặcmongoexport --collection=events --db=reporting --out=events.json
47 parameter to themongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
50, ormongoexport --collection=events --db=reporting --out=events.json
Biến môi trường
46.mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
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]
23mongoexport --uri="mongodb://mongodb0.example.com:27017/reporting" --collection=events --out=events.json [additional options]
23mongoexport --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-1Default: 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]
4mongoexport --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