In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following mainly brings you how to import some Mongodb data into mysql database. I hope these contents can bring you practical use. This is also the main purpose of this article that I edit part of Mongodb data how to import mysql database. All right, don't talk too much nonsense, let's just read the following.
Filter and export mongodb data based on time
1. First convert the time in mongodb to a timestamp:
ISODate ("2016-12-01 001V 00.000mm 08V") .valueOf ()
1334592000000
Then you can query it according to the obtained timestamp.
Export:
-d is the database
-c is a set
-o File name of the output
-csv means to export to csv format
-f indicates which columns (fields) need to be exported
Filter conditions added by-Q
. / mongoexport-h 127.0.0.1-- port 20017-d xxx-c xxx-- csv-f xxxx-Q'{"status_time": {$gt: new Date (1482681600000), $lt:new Date (1482768000000)}'- o xxxx
Import: enter the mysql database:
LOAD DATA LOCAL INFILE 'export file full path' INTO TABLE database table name FIELDS TERMINATED BY','
For the above about how to import some Mongodb data into mysql database, we do not think it is very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Select to_date ('2005-12-25 Person13-25-5-5-5-5) from dual
© 2024 shulou.com SLNews company. All rights reserved.