Alibabacloud.com offers a wide variety of articles about import json file into mongodb, easily find your import json file into mongodb information here online.
user--type csv--headerline--fileUser_csv.datConnected to:127.0.0.1Imported 3 objects[Email protected] bin]#Parameter description:-type indicates the file format to import-headerline The first row is not imported because the first row is a column name-file indicates the file path to importAttention:CSV format is good,
--fileUser_csv.datConnected to:127.0.0.1Imported 3 objects[Email protected] bin]#Parameter description:-type indicates the file format to import-headerline The first row is not imported because the first row is a column name-file indicates the file path to importAttention:CSV format is good, mainstream database suppor
at the JSON above, as explained above, the JSON should be converted to the following form:{ "_id": "555df36ec6cd08ea807a4324", "name": "Xiaomi Phone", "Comments.0.text": "The phone is genuine", "Comments.1.text ":" Logistics is so damn fast "}Then submit it to SOLR. And we don't see anything in the official documentation that needs to be configured, is it OK to install it by default? oh,no~~~
"--csv-o/root/test.csv
Export data based on criteria:
Copy Code code as follows:
# mongoexport-d Yourdb-c yourcoll-q ' {score:{$gt: '} '-o/root/yourcoll-bk.json
More Mongoexport Detailed
Collection Data Import-mongoimport
To restore the exported collection data:
Copy Code code as follows:
# mongoimport-d Yourdb-c Yourcoll--file/root/yourcoll.json
[-- collection] arg collection to use (some commands)-- Objcheck validate object before inserting(Default)-- Noobjcheck don't validate object before inserting-- Filter arg filter to apply before inserting-- Drop each collection before import-- OplogReplay replay oplog for point-in-time restore-- OplogLimit arg include oplog entries beforeProvided Timestamp (seconds [: ordinal])During the oplog replay; the ordinalValue is optional-- KeepIndexVersi
.
Net.ipv6
Boolean, default to FalseTurn on the IPV6 feature, which defaults to off.
Net.http.JSONPEnabled
Boolean, default to FalseRunning JSON to access the HTTP port can lead to more unsafe factors.
Net.http.RESTInterfaceEnabled
Boolean, default to FalseEven if the HTTP interface option is turned off, opening exposes the HTTP interface, which can lead to more unsafe factors.
4. Security
Security.ke
Tags: mongod database BSP backup file export save files--useExport of databasesmongoexport-d database name-C collection name----Save address of export file and save file name. JSON--type JSONImport of databasesmongoimport-d database name-C collection name--file the
Tags: style blog color io using ar strong for SPMongoDB Import Script#!/bin/shEcho"${0} Import data to MongoDB"Tagfile="/srv/mss_data/dim_customerex_mobile_stat_ ' Date +%y%m%d-d"-1 Day"'. Log"Impdatafile="/srv/mss_data/dim_customerex_mobile_stat_ ' Date +%y%m%d-d"-1 Day"'. txt"TableName="${1}"Echo"Tagfile:${tagfile}"Echo"Impdatafile:${impdatafile}"Echo"Tablename
exported collection Mytest.bson under the specified directory into the Restesss collection under the test databaseAfter the import we look at all the collections under test this database: Db.getcollectionnames (), we found that there are imported collectionsthird, export import1. Export tool MongoexportThe Mongoexport tool in MongoDB can export a collection to a file
Tags: script ati detail OCA value get STS data target in the previous article, we saved the data crawled by the crawler in JSON format, but in order to be able to process the data more conveniently. We want to import this data into the MySQL database. phpMyAdmin can export data from a MySQL database to a JSON-formatted file
password-D database-C table name-F field-Q conditional export--csv-o file name specific path (suffix format can be. dat or. csv); mongoimport Import the table, or some of the fields in the table : 1. restore a non-CSV file exported from an entire table Command format: mongoimport-h IP--port Port-u user name-p password-D database-C table name--upsert--drop
[MongoDB] Export Import and Export export of data (1), export db1_import
In the software development, we usually are faced with a common question of exporting or importing data from database. So in this blog we will together study the specified DDB export and mongodb import.
I. Export
1.The content of the Data user.csv file imported into the csvformat is as follows: _ id, name, ageObjectID (4eed9f9ca939118694cf05e4), ming, 10 ObjectI
1. The contents of the user.csv file for importing CSV data are as follows: _ id, name, age ObjectID (4eed9f9ca939118694cf05e4), ming, 10 ObjectI
1. Import CSV data
The content of the user.csv
One, remote connection MongoDBConnection command:mongo-u username-p pwd 192.168.41.215:27017/database (database for user name)Second,mongodump backup DatabaseExport command:mongodump-h IP--port Port-u user name-p password-d database-o file exists path Detailed Explanation: The server address where the-H:MONGODB is located (must specify a port), if not specified, is the local 127.0.0.1:27017-U: User name-P: Password-D: The database that needs to be
Suppose there is a user table in the database with two records in it. We want to export it.
Common export Methods[Root @ localhost bin] #./export-D my_mongodb-C user-o User. dat
Connected to: 127.0.0.1
Exported 2 records
[Root @ localhost bin] # Cat user. dat
{"_ Id": {"$ oid": "4f81a4a1779282ca68fd8a5a" }," uid ": 2," username ":" Jerry "," Age ": 100}
{"_ Id": {"$ oid": "4f844d1847d25a9ce5f120c4"}, "uid": 1, "username": "Tom", "Age": 25}
[Root @ localhost bin] #
Parameter description
-D indic
One: The export function of MongoDBMongoDB provides the ability to import and export, respectively, the Mongoexport.exe and Mongoimport.exe files in the MongoDB download directory, the specific Export command format is as follows:Mongoexport-h dbhost-d dbname-c collectionname-o outputParameter description:-H Database Address-d indicates which library to use-C indicates the collection to be exported-O indica
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.