简体   繁体   English

如何使用mongo连接器导入指定的收集数据

[英]how to import specified collection data using mongo connector

I am importing data from mongodb 3.4.6 to solr 7.6.0 all of data is imported but i need to import from some specified database to some collections only not all of the data. 我正在将数据从mongodb 3.4.6导入到solr 7.6.0中,所有数据均已导入,但我需要从某些指定的数据库中导入到某些集合中,而不是所有数据。 and i want to get only some specified fields from the collection. 我只想从集合中获取一些指定的字段。 how to import in that manner please tell us. 如何以这种方式导入,请告诉我们。

Depending on your version of mongo-connector, you can either use the -n parameter (pre 2.5.0), or the namespaces configuration setting (2.5.0+): 根据您的mongo-connector版本,您可以使用-n参数(2.5.0之前的版本),也可以使用namespaces配置设置 (2.5.0+):

namespaces Default: Include all namespaces except system and GridFS collections. namespaces默认值:包括除系统和GridFS集合以外的所有名称空间。

NEW in 2.5.0: The namespaces configuration option is used to control how and which MongoDB namespaces are replicated. 2.5.0中的新增功能:名称空间配置选项用于控制复制方式和复制MongoDB名称空间的方式。 By default, Mongo Connector will replicate all namespaces except for system and GridFS collections. 默认情况下,Mongo Connector将复制除系统和GridFS集合以外的所有名称空间。 Namespaces should be given as database_name.collection_name. 命名空间应指定为database_name.collection_name。 Each namespace may contain a single wildcard ( ) which matches any characters. 每个名称空间都可以包含一个与任何字符匹配的通配符( )。 For example, db_ .foo matches db_bar.foo and db_a.foo. 例如,db_ .foo与db_bar.foo和db_a.foo匹配。

You tell mongo-connector which configuration to use with the -c parameter: 您可以通过-c参数告诉mongo-connector使用哪种配置:

mongo-connector -c config.json

To index into a specific collection, give the collection name to the -t parameter : 要索引到特定集合中, 请将集合名称赋予-t参数

-t http://localhost:8983/solr/MyCore

To only index specific fields, use the fields configuration option or the -i command line argument. 要仅索引特定字段,请使用fields配置选项-i命令行参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用mongo-connector将数据从mongodb导入到apache solr - How to import data from mongodb to apache solr using mongo-connector 如何使用Spark和Mongo Hadoop连接器更新mongo集合中的多个字段? - How to update multiple fields in mongo collection using spark and mongo Hadoop connector? 如何使用pymongo过滤mongo集合中的数据 - How to filter data in mongo collection using pymongo 如何使用mongo-connector仅对特定mongodb数据库中的特定集合进行索引(elasticsearch)。 - how to index (elasticsearch) only specific collection in a specific mongodb database using mongo-connector. 使用 cmd 在 mongo 中导入和导出单个集合 - Import and export single collection in mongo using cmd mongo-hadoop connector:如何查询数据 - mongo-hadoop connector:how to query data 如何使用spring数据从mongo集合中仅获取指定的对象类 - How to get only specified object class from mongo collection with spring data 如何使用 spark mongo 连接器在 mongo 查询管道中使用聚合 - How to use aggregate in the mongo query pipeline using spark mongo connector 如何使用解析服务器从现有的 mongo 集合中获取数据? - how to get data from existing mongo collection using parse server? 如何使用均值堆栈将数据发布到mongo集合? - How to post data to mongo collection using Mean stack?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM