MongoDB mongodump Exporting data by Time zone

Source: Internet
Author: User
Tags mongodump mongo shell

According to Objectid, time can be drawn.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/76/0C/wKioL1ZJgHrhk31fAAAfQwCw9Eg777.png "title=" M.png " alt= "Wkiol1zjghrhk31faaafqwcw9eg777.png"/>


Time zone

["2014-01-01 00:00:00", "2015-11-15 00:00:00")


In the MONGO shell, generate the ID of this area based on time

begin = New Date ("2014-01-01 00:00:00"). GetTime ()/1000

Begin = Begin.tostring (16)

Begin = begin + New Array (+). Join ("0")


Draw 52c2ea000000000000000000


end = new Date ("2015-11-15 00:00:00"). GetTime ()/1000

End = End.tostring (16)

End = end + new Array (+). Join ("0")


Draw 56475a800000000000000000


Start Data Guide

Mongodump--host 127.0.0.1:10000-d pics-c fs.files-q ' {_id:{$gte: ObjectId ("52c2ea000000000000000000"), $lt: ObjectId ( "56475a800000000000000000")}} '-O dump_pics/




MongoDB mongodump Exporting data by Time zone

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.