Spark-MongoDB icon indicating copy to clipboard operation
Spark-MongoDB copied to clipboard

Can I give a filter term when loading data from mongodb

Open DeeeFOX opened this issue 8 years ago • 0 comments

As title said, examples show me the code that loading a whole data set from the mongodb collection: job_ctx.read.format(source_format).options(host=mongo_url, database=db, collection=col).load()

But I don't need the whole set and what filter the data at mongodb side like the following job_ctx.read.format(source_format).options(host=mongo_url, database=db, collection=col).load('{ qty: { $ne: 20 }')

How can I do by Spark-MongoDB frame in Python

DeeeFOX avatar Sep 30 '16 07:09 DeeeFOX