Spark: Mongo-Hadoop how to query

325 Views Asked by At

I am trying to do a $near query with MongoDB using Spark and mongo-hadoop with lat/lon coordinates that change. How can I do a query with mongo-hadoop?

Apart from somethnig like:

mongodbConfig.set("mongo.input.query", "{'field':'value'}") I cannot see anything with sense.

any idea?

1

There are 1 best solutions below

1
On

I suggest you can see the com.mongodb.hadoop.util.MongoConfigUtil, there are lots of config query settings:

mongodbConfig.set("mongo.input.query","{key:{\"$eq\":20160517080039}}");
mongodbConfig.set("mongo.input.fields","{key:0}");
mongodbConfig.setInt("mongo.input.limit", 1);