--queryFile=<path> Specifies the path to a file containing a JSON document as a query filter that limits the documents included in the output ofmongodump.--queryFileenables you to create query filters that are too large to fit in your terminal's buffer. ...
-c, --collection=<collection-name> collection to use query options: -q, --query= query filter, as a JSON string, e.g., '{x:{$gt:1}}' --queryFile= path to a file containing a query filter (JSON) --readPreference=<string>|<json> specify either a preference name or a preference...
mongo --eval "db.getCollectionNames().filter(function(c) { return c.startsWith('a'); })" ``` 这将列出所有以"a"开头的集合名称。 2.备份数据库:有了集合的名称后,你可以使用`mongodump`进行备份。假设你想备份名为`mydatabase`的数据库,并只导出上述查询到的集合,你可以使用以下命令: ```bash...
mongodump及mongorestore是用于备份和恢复mongodb数据库的两个命令,位于mongodb安装目录的bin文件夹下。 mongodump导出的备份文件为二进制格式,每一个文档的对应备份文件有两个,文档名.bson和文档名.metadata.json两个文件。 先看一个mongodump的使用示例: ./mongodump -d vodlite3 -o /mibackup/ 该命令将vodlit...
23. --filter arg filter to apply before inserting 24. --drop drop each collection before import 25. --oplogReplay replay oplog for point-in-time restore 26. --keepIndexVersion don't upgrade indexes to newest version 1. 2. 3. 4. ...
--filter arg filter to apply before inserting --drop drop each collection before import --oplogReplay replay oplog for point-in-time restore --keepIndexVersion don't upgrade indexes to newest version 参数说明: -h:指明数据库宿主机的IP
–filter arg 插入前的过滤器 –indexesLast 插入完数据后再建立索引(此参数可提供更高的性能,建议选用) 说明: 1.与mongodump合用,在restore过程中,索引会重新创造 性能:1g数据,约6分钟 小结: 备份方面:mongodump的速度和压缩率都最好,每秒125M的数据,压缩率达28% ...
mongorestore --filter '{"field": 1}' Here, mongorestore only adds documents to the database from the dump located in the dump/ folder if the documents have a field name field that holds a value of 1. Enclose the filter in single quotes (e.g. ') to prevent the filter from interac...
Convey("count collection with filter in BSON.M", func() { findQuery := &db.DeferredQuery{Coll: collection, Filter: bson.M{"age": 1}} cnt, err := findQuery.Count() So(err, ShouldBeNil) So(cnt, ShouldEqual, 1) })Convey("count collection with filter in BSON.D", func() {...
mongodb/mongo-toolsPublic NotificationsYou must be signed in to change notification settings Fork355 Star987