Python (32-bit) must be installed on the Voyager Server machine. Ideally, the Python version should be 2.7.
DO NOT USE EARLIER VERSIONS OF PYTHON
After confirming the dependencies, you need to add a new location.
To create a new location:
This configuration indexes all the collections in a MongoDB database. It includes all the fields and maps only one field for all tables. The use of the asterisk (*) in this configuration means to include all fields, all tables and apply the field mapping in all tables.
{
"name": "mongodb_sample1",
"type": "python",
"config": {
"fields": {
"include": ["*"]
},
"tables": [
{
"name": "*",
"action": "INCLUDE"
},
{
"name": "*",
"map": {"NAME": "name"}
}
],
"mongodb": {
"client": "mongodb://localhost:27017/",
"database": "usa"
}
}
}
Index a single collection.
{
"name": "USA_CITIES",
"type": "python",
"config": {
"fields": {
"include": ["*"]
},
"tables": [
{
"name": "CITIES",
"action": "INCLUDE"
},
{
"name": "*",
"map": {
"NAME ": "name"
}
} ],
“wkt”: “true”,
"mongodb": {
"client": "mongodb://localhost:27017/",
"database": "usa"
}
}
}
}
This example demonstrates the following:
{
"name": "MongoDB_Sample3",
"type": "python",
"config": {
"fields": {"include": ["*"]},
"tables": [
{
"name": "STATES",
"action": "INCLUDE"
"map": {"STATE_NAME": "name"},
"query": "{‘STATE_NAME’: 'California'}"
},
{
"name": "CITIES",
"action": "INCLUDE"
"map": {"CITY_NAME": "name"},
"query": "{‘CITY_NAME’: 'Redlands'}"
}
],
"mongodb": {
"client": "mongodb://localhost:27017/",
"database": "usa"
}
}
}
This example demonstrates the support for GridFS. GridFS is a convention in MongoDB for storing files or arbitrary size and convenient for storing large files and binary objects in MongoDB. In this example, the key “gridfs” is included and set to “true”. For more information about GridFS, see here.
{
"name": "MongoDB_GridFS",
"type": "python",
"config": {
"fields": {
"include": ["*"]
},
"tables": [
{
"name": "fs.files",
"action": "INCLUDE"
},
{
"name": "null.files",
"action": "INCLUDE"
},
{
"name": "*",
"map": {
"uuid": "id",
"filename": "name",
"author": "author"
}
}
],
"mongodb": {
"client": "mongodb://localhost:27017/",
"database": "largefiles",
"gridfs": "true"
}
}
}