Hướng dẫn how do i export a mongodb database to another server? - làm cách nào để xuất cơ sở dữ liệu mongodb sang một máy chủ khác?

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

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

4 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]

4 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]

6.

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

4
from the system command line, not the

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

6
shell.

Mẹo

Xem thêm:

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

7 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]

4 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]

9. Trước đây,

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

4 đã đượ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]

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

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

9. Previously,

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

4
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]

4, hãy tham khảo 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]

4
, 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]

4.

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

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

4 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]

9. Trước đây,

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

4 đã đượ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]

2 supports the following versions of the MongoDB Server:

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

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

    4, hãy tham khảo tài liệu máy chủ MongoDB cho phiên bản đó của công cụ:

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

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

    2 của

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

    4.

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

    4 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]

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

  • MongoDB 6.0

MongoDB 5.0

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

4 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]

2 is supported on the following platforms:

x86_64

ARM64

PPC64LE

s390x

MongoDB 4.2

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

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

Mặc dù

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

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

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

Mặc dù

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

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

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

Mặc dù

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

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

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

Mặc dù

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

4 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]

4 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]

2 đượ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]

4
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]

4.

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

4 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]

4 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]

6.

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

4
from the system command line, not the

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

6
shell.

Amazon 2013.03+

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

4 to export. If you do not specify an

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

5
,

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

4
writes to the standard output [e.g. stdout].

Debian 10

Debian 9

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

4 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]

5
from a local MongoDB instance running on port 27017:

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

Debian 8

  • Rhel / Centos 8

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

    9

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

    Rhel / Centos 7

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

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

  • Rhel / Centos 6

    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]

    1

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

  • SUSE 15

    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]

    1 and

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

    3

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

SUSE 12Options.

Ubuntu 20.04

  • Ubuntu 18.04

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

    9

    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]

    Rhel / Centos 7

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

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

  • Rhel / Centos 6

    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]

    1

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

SUSE 15

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

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

  • SUSE 12

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

    9

    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]

    Ubuntu 20.04

    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]

    9 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]

    Rhel / Centos 7

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

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

  • Rhel / Centos 6

    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]

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

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

    SUSE 15read preference tag sets, and the optional maxStalenessSeconds:

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

    0

SUSE 12Options.

Ubuntu 20.04

  • Ubuntu 18.04

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

    3 instance in the

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

    9

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

    1

    Rhel / Centos 7

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

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

  • Rhel / Centos 6

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

    3 instance in the

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

    1

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

    2

SUSE 15

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

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

  • SUSE 12

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

    9

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

    3

    Ubuntu 20.04

    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]

    9 option:

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

    4

    Rhel / Centos 7

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

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

  • Rhel / Centos 6

    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]

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

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

    5

    SUSE 15read preference tag sets, and the optional maxStalenessSeconds:

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

    6

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

Mẹo

Xem thêm:

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

4 yêu cầu truy cập đọc trên cơ sở dữ liệu đích. requires read access on the target database.

Đả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]

5 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]

5
role on the target database.

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]

6 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]

3 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]

6
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]

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

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]

4 để 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 --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]

9 thành

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

4, theo kiểu sau:BSON data types when using

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

4
to perform full instance backups, be sure to specify Extended JSON v2.0 [Canonical mode] 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]

9
option to

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

4
, in the following fashion:

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

7

Nếu

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]

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

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

4 Dữ liệu đầu ra trong JSON v2.0 mở rộng [chế độ thư giãn] theo mặc đị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]

9
is unspecified,

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

4
outputs data in Extended JSON v2.0 [Relaxed mode] by default.

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

7 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]

4 với

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

05 được chỉ định.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]

4
with

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

05 specified.

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

4 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]

6

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

3 được cấu hình để sử dụng chế độ FIP. 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]

6

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

3
that is configured to use FIPS mode.

Theo mặc định,

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

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

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

10. Để 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]

1 hoặc trong

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

9

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

4
uses read preference

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

10
. 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]

1
command line option or in the

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

9

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]

1, 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]

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

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

1
, 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]

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

Cảnh báo

Nhập dữ liệu và xuất xung đột với [$] và [.]

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

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

15] có tiền tố và có thể chứa một [

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

16]. Tuy nhiên,

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

7 và

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

4 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]

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

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

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

15] các khóa có tiền tố. Cơ chế DBREF là một ngoại lệ cho quy tắc chung này. 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

15] prefixed keys. The DBRef mechanism is an exception to this general rule.

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

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

7 và

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

4 với [

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

16] trong tên trường. Vì các tệp CSV sử dụng [

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

16] để biểu thị phân cấp dữ liệu, A [

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

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

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

4
with [

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

16] in field names. Since CSV files use the [

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

16] to represent data hierarchies, a [

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

16] in a field name will be misinterpreted as a level of nesting.

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

25 returns 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]

4

Returns information on the options and use of

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

4

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

27 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

28 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

29.]

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

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

28 form by including the option multiple times, [e.g.

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

29.]

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

30Run

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

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

Runs

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

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

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

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

  • Hoạt động sao chép

  • kết nối các sự kiện được chấp nhận

  • Kết nối các sự kiện đóng

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

32 returns Số phát hành

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

4.

Returns the

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

4 release number.

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

34New trong phiên bản 100.3.0.

New in version 100.3.0.

Chỉ định đường dẫn đầy đủ đến tệp cấu hình YAML chứa các giá trị nhạy cảm cho các tùy chọn sau đến

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

4:

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

4
:

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

    36

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

    37

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

    38

Đây là cách được đề xuất để chỉ định mật khẩu thành

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

4, ngoài việc chỉ định nó thông qua dấu nhắc mật khẩu.

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

4
, aside from specifying it through a password prompt.

Tệp cấu hình có biểu mẫu sau:

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

8

Chỉ định mật khẩu cho trường

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

40 và cung cấp chuỗi kết nối trong trường

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

41 có chứa mật khẩu mâu thuẫn sẽ dẫn đến lỗi.

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

42Specifying Chuỗi kết nối URI có thể giải quyết được của triển khai MongoDB, được đặt trong các trích dẫn:

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

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

9

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

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

43 của

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

4, 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

37:

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

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

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

37
option:

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

0

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

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

46 hoặc

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

47. Ví dụ:

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

1

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

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

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

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

37
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

42Specifying 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

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

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

50
and

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

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

Ghi chú

Cảnh báo

Nhập dữ liệu và xuất xung đột với [$] và [.]

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

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

  • 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

  • Sử dụng tùy chọn

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

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

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

    54
    option to specify a configuration file containing the password.

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

55Default: Localhost: 27017

Default: localhost:27017

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]

4 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

57.

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

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

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

57.

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

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

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

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

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

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

2

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]

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

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

4
always connects to the primary.

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 đó:

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

3

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

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

60, 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

61].

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

62. 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]

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

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

62
. 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]

1
and specifying conflicting information will result in an error.

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

64Default: 27017

Default: 27017

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

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

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

62. 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]

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

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

62
. 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]

3
and specifying conflicting information will result in an error.

Kết nối

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

67Enables 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]

6 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]

3 có hỗ trợ TLS/SSL được bật.

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]

6 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]

3
that has TLS/SSL support enabled.

Ngoài ra, bạn cũng có thể định cấu hình hỗ trợ TLS/SSL trực tiếp trong

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

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

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

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

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

62
. Providing a connection string while also using

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

67
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.

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

72Spec chỉ định tệp

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

73 có chứa chuỗi chứng chỉ gốc từ cơ quan chứng chỉ. Chỉ định tên tệp của tệp

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

73 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

73 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

73 file using relative or absolute paths.

Ngoài ra, bạn cũng có thể chỉ định tệp

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

75 trực tiếp trong

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

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

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

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

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

62
. Providing a connection string while also using

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

77
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.

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

72Spec chỉ định tệp

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

73 có chứa chuỗi chứng chỉ gốc từ cơ quan chứng chỉ. Chỉ định tên tệp của tệp

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

73 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

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

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

73 file using relative or absolute paths.

Ngoài ra, bạn cũng có thể chỉ định tệp

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

75 trực tiếp trong

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

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

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

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

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

67
option to connect to a

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

6
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]

3
that has

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

84
enabled without

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

85

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

78 Chỉ định tệp

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

73 chứa cả chứng chỉ và khóa TLS/SSL. Chỉ định tên tệp của tệp

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

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

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

62
. Providing a connection string while also using

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

88
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.

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

72Spec chỉ định tệp

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

73 có chứa chuỗi chứng chỉ gốc từ cơ quan chứng chỉ. Chỉ định tên tệp của tệp

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

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

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

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

88]. Use the

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

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

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

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

Ngoài ra, bạn cũng có thể chỉ định tệp

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

75 trực tiếp trong

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

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

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

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

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

38
option, the

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

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

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

78 Chỉ định tệp

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

73 chứa cả chứng chỉ và khóa TLS/SSL. Chỉ định tên tệp của tệp

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

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

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

62
. Providing a connection string while also using

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

38
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.

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

72Spec chỉ định tệp

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

73 có chứa chuỗi chứng chỉ gốc từ cơ quan chứng chỉ. Chỉ định tên tệp của tệp

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

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

Ngoài ra, bạn cũng có thể chỉ định tệp

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

75 trực tiếp trong

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

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

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

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

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

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

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

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

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

78 Chỉ định tệp

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

73 chứa cả chứng chỉ và khóa TLS/SSL. Chỉ định tên tệp của tệp

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

73 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

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

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

73 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.

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

72Spec chỉ định tệp

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

73 có chứa chuỗi chứng chỉ gốc từ cơ quan chứng chỉ. Chỉ định tên tệp của tệp

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

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

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

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

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

Cảnh báo

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

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

03 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]

03 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.

Kết nối với ví dụ

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

6 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]

3 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, xem

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

09.

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
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]

3
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]

09.

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

62. 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]

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

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

62
. Providing a connection string while also using

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

03
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.

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

09Disable 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]

4 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.

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

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

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

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

62. 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]

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

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

62
. Providing a connection string while also using

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

09
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.

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

09Disable 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]

4 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 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

36 and

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

18
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

62. 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]

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

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

62
. Providing a connection string while also using

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

50
and specifying conflicting information will result in an error.

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

16 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

36 và

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

18.MongoDB Atlas cluster using the

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

21

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

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

  • 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

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

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

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

  • Nếu kết nối với cụm Atlas MongoDB bằng cách sử dụng

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

    21

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

    22, bạn có thể chỉ định ID khóa truy cập AWS của mình trong:

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

    49
    , or

  • vùng này,

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

49, hoặcConnect to a MongoDB Atlas Cluster using AWS IAM Credentials for an example of each.

Biến môi trường

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

24.

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

50 and

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

18
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.

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

50 option without

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

36
or specify an empty string as the

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

36
value, as in

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

31 .

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

25 chỉ định một mật khẩu để 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

50 và

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

18.

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

62
. Providing a connection string while also using

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

36
and specifying conflicting information will result in an error.

Để nhắc người dùng về mật khẩu, hãy truyền tùy chọn

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

50 mà không cần

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

36 hoặc chỉ định một chuỗi trống dưới dạng giá trị

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

36, như trong

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

31.MongoDB Atlas cluster using the

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

21

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

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

  • 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

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

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

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

  • Nếu kết nối với cụm Atlas MongoDB bằng cách sử dụng

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

    21

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

    22, bạn có thể chỉ định ID khóa truy cập AWS của mình trong:

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

    49
    , or

  • vùng này,

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

49, hoặcConnect to a MongoDB Atlas Cluster using AWS IAM Credentials for an example of each.

Cảnh báo

Biến môi trường

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

24.

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

36
option may be visible to system status programs such as

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

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

  • 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.

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

    36 option to receive an interactive password prompt, or

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

    25 chỉ định một mật khẩu để 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

    50 và

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

    18.

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

    54
    option to specify a configuration file containing the password.

Để nhắc người dùng về mật khẩu, hãy truyền tùy chọn

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

50 mà không cần

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

36 hoặc chỉ định một chuỗi trống dưới dạng giá trị

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

36, như trong

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

31.

If connecting to a MongoDB Atlas cluster using the

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

21

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

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

  • 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

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

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

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

  • Nếu kết nối với cụm Atlas MongoDB bằng cách sử dụng

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

    21

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

    22, bạn có thể chỉ định ID khóa truy cập AWS của mình trong:

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

    46
    parameter to the

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

    49
    , or

  • vùng này,

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

49, hoặcConnect to a MongoDB Atlas Cluster using AWS IAM Credentials for an example of each.

Biến môi trường

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

24.

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

22

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.

Specifies the authentication database where the specified

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

50 has been created. See Authentication Database.

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

25 chỉ định một mật khẩu để 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

50 và

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

18.

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

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

Để nhắc người dùng về mật khẩu, hãy truyền tùy chọn

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

50 mà không cần

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

36 hoặc chỉ định một chuỗi trống dưới dạng giá trị

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

36, như trong

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

31.GSSAPI [Kerberos], PLAIN [LDAP SASL], or

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

21

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

55
, you must set

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

18
to

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

57.

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

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

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

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

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

62
. Providing a connection string while also using

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

18
and specifying conflicting information will result in an error.

Nếu kết nối với cụm Atlas MongoDB bằng cách sử dụng

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

21

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

22, bạn có thể chỉ định khóa truy cập bí mật AWS của mình trong:

Default: SCRAM-SHA-1

Biến môi trường

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

37.

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

4
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]

6
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]

3

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

36 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

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

Bài Viết Liên Quan

Chủ Đề